home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / tkern10.zip / SRC\PROCESS.ASM < prev    next >
Assembly Source File  |  1994-07-03  |  94KB  |  4,940 lines

  1.     .286p
  2.     ifndef    ??version
  3. ?debug    macro
  4.     endm
  5. publicdll macro    name
  6.     public    name
  7.     endm
  8. $comm    macro    name,dist,size,count
  9.     comm    dist name:BYTE:count*size
  10.     endm
  11.     else
  12. $comm    macro    name,dist,size,count
  13.     comm    dist name[size]:BYTE:count
  14.     endm
  15.     endif
  16.     ?debug    V 301h
  17.     ?debug    S "process.c"
  18.     ?debug    C E9A155E31C0970726F636573732E63
  19.     ?debug    C E948B1AE1C122E2E5C696E636C7564655C737464696F2E68
  20.     ?debug    C E9B0A2B01C182E2E5C696E636C7564655C7379732F746B70726F74+
  21.     ?debug    C 6F2E68
  22.     ?debug    C E90020821B18433A5C4243345C494E434C5544455C77696E646F77+
  23.     ?debug    C 732E68
  24.     ?debug    C E90020821B19433A5C4243345C494E434C5544455C746F6F6C6865+
  25.     ?debug    C 6C702E68
  26.     ?debug    C E90020821B17433A5C4243345C494E434C5544455C7374646C6962+
  27.     ?debug    C 2E68
  28.     ?debug    C E90020821B16433A5C4243345C494E434C5544455C5F646566732E+
  29.     ?debug    C 68
  30.     ?debug    C E90020821B17433A5C4243345C494E434C5544455C6D656D6F7279+
  31.     ?debug    C 2E68
  32.     ?debug    C E90020821B14433A5C4243345C494E434C5544455C6D656D2E68
  33.     ?debug    C E90020821B17433A5C4243345C494E434C5544455C737472696E67+
  34.     ?debug    C 2E68
  35.     ?debug    C E90020821B17433A5C4243345C494E434C5544455C6C6F63616C65+
  36.     ?debug    C 2E68
  37.     ?debug    C E90020821B16433A5C4243345C494E434C5544455C616C6C6F632E+
  38.     ?debug    C 68
  39.     ?debug    C E90020821B17433A5C4243345C494E434C5544455C737464617267+
  40.     ?debug    C 2E68
  41.     ?debug    C E90020821B16433A5C4243345C494E434C5544455C6572726E6F2E+
  42.     ?debug    C 68
  43.     ?debug    C E90FA6AE1C162E2E5C696E636C7564655C7379732F7466696C652E+
  44.     ?debug    C 68
  45.     ?debug    C E9F2A5AE1C182E2E5C696E636C7564655C7379732F746465766963+
  46.     ?debug    C 652E68
  47.     ?debug    C E90FA6AE1C162E2E5C696E636C7564655C7379732F7466696C652E+
  48.     ?debug    C 68
  49.     ?debug    C E95651E31C152E2E5C696E636C7564655C7379732F7461736B2E68
  50.     ?debug    C E9E1B0AE1C162E2E5C696E636C7564655C7379732F696F63746C2E+
  51.     ?debug    C 68
  52.     ?debug    C E984695B1C142E2E5C696E636C7564655C7379735C7474792E68
  53.     ?debug    C E9A8A6AE1C152E2E5C696E636C7564655C7379732F776169742E68
  54.     ?debug    C E92AA6AE1C162E2E5C696E636C7564655C7379732F746B65726E2E+
  55.     ?debug    C 68
  56. PROCESS_TEXT    segment word public 'CODE'
  57. PROCESS_TEXT    ends
  58. DGROUP    group    _DATA,_BSS
  59.     assume    cs:PROCESS_TEXT,ds:DGROUP
  60. _DATA    segment word public 'DATA'
  61. d@    label    byte
  62. d@w    label    word
  63. _DATA    ends
  64. _BSS    segment word public 'BSS'
  65. b@    label    byte
  66. b@w    label    word
  67. _BSS    ends
  68. _DATA    segment word public 'DATA'
  69. _nTasks    label    word
  70.     db    0
  71.     db    0
  72. nProcesses    label    word
  73.     db    0
  74.     db    0
  75. nZombies    label    word
  76.     db    0
  77.     db    0
  78. ptNext    label    dword
  79.     db    0
  80.     db    0
  81.     db    0
  82.     db    0
  83. ptLast    label    dword
  84.     db    0
  85.     db    0
  86.     db    0
  87.     db    0
  88. ptParent    label    dword
  89.     db    0
  90.     db    0
  91.     db    0
  92.     db    0
  93. htaskParent    label    word
  94.     db    0
  95.     db    0
  96. pidParent    label    word
  97.     db    0
  98.     db    0
  99. pidChild    label    word
  100.     db    0
  101.     db    0
  102. nPIDNext    label    word
  103.     db    3
  104.     db    0
  105. _DATA    ends
  106. PROCESS_TEXT    segment word public 'CODE'
  107.     ?debug    C E8010970726F636573732E63A155E31C
  108.    ;    
  109.    ;    GetTaskInfo(void)
  110.    ;    
  111.     ?debug    L 74
  112.     assume    cs:PROCESS_TEXT,ds:DGROUP
  113. _GetTaskInfo    proc    far
  114.     ?debug    B
  115.     mov    ax,DGROUP
  116.     inc    bp
  117.     push    bp
  118.     mov    bp,sp
  119.     push    ds
  120.     mov    ds,ax
  121.     sub    sp,2
  122.     push    si
  123.     ?debug    B
  124.    ;    
  125.    ;    {
  126.    ;        HTASK    hTask;
  127.    ;        int    i;
  128.    ;    
  129.    ;        hTask = GetCurrentTask();
  130.    ;    
  131.     ?debug    L 79
  132.     call    far ptr GETCURRENTTASK
  133.     mov    word ptr [bp-4],ax
  134.    ;    
  135.    ;        for (i = 0; i < TNTASK; i++)
  136.    ;    
  137.     ?debug    L 80
  138.     xor    si,si
  139.     jmp    short @1@310
  140. @1@58:
  141.    ;    
  142.    ;        {
  143.    ;            if (_tasks[i].hTask == hTask)
  144.    ;    
  145.     ?debug    L 82
  146.     mov    bx,si
  147.     imul    bx,bx,74
  148.     mov    ax,word ptr DGROUP:__tasks[bx]
  149.     cmp    ax,word ptr [bp-4]
  150.     jne    short @1@282
  151.    ;    
  152.    ;            {
  153.    ;                /* If the task is in fledgeling mode,
  154.    ;                 * don't deliver signals.
  155.    ;                 */
  156.    ;                if (_tasks[i].nSignal &&
  157.    ;    
  158.     ?debug    L 87
  159.    ;    
  160.    ;                    _tasks[i].iFledgeling == -1)
  161.    ;    
  162.     ?debug    L 88
  163.     mov    bx,si
  164.     imul    bx,bx,74
  165.     cmp    word ptr DGROUP:__tasks[bx+64],0
  166.     je    short @1@170
  167.     mov    bx,si
  168.     imul    bx,bx,74
  169.     cmp    word ptr DGROUP:__tasks[bx+4],-1
  170.     jne    short @1@170
  171.    ;    
  172.    ;                {
  173.    ;                    (*_tasks[i].intrproc)(_tasks[i].nSignal);
  174.    ;    
  175.     ?debug    L 90
  176.     mov    bx,si
  177.     imul    bx,bx,74
  178.     push    word ptr DGROUP:__tasks[bx+64]
  179.     mov    bx,si
  180.     imul    bx,bx,74
  181.     call    dword ptr DGROUP:__tasks[bx+70]
  182.    ;    
  183.    ;                    _tasks[i].nSignal = 0;
  184.    ;    
  185.     ?debug    L 91
  186.     mov    bx,si
  187.     imul    bx,bx,74
  188.     mov    word ptr DGROUP:__tasks[bx+64],0
  189. @1@170:
  190.     jmp    short @1@226
  191. @1@198:
  192.    ;    
  193.    ;                }
  194.    ;    
  195.    ;    
  196.    ;                while (_tasks[i].iFledgeling != -1)
  197.    ;                    i = _tasks[i].iFledgeling;
  198.    ;    
  199.     ?debug    L 96
  200.     mov    bx,si
  201.     imul    bx,bx,74
  202.     mov    si,word ptr DGROUP:__tasks[bx+4]
  203. @1@226:
  204.     ?debug    L 95
  205.     mov    bx,si
  206.     imul    bx,bx,74
  207.     cmp    word ptr DGROUP:__tasks[bx+4],-1
  208.     jne    short @1@198
  209.     jmp    short @1@422
  210. @1@282:
  211.     ?debug    L 80
  212.     inc    si
  213. @1@310:
  214.     cmp    si,20
  215.     jl    short @1@58
  216.    ;    
  217.    ;                return &_tasks[i];
  218.    ;            }
  219.    ;        }
  220.    ;        for (i = 0; i < TNTASK; i++)
  221.    ;    
  222.     ?debug    L 100
  223.     xor    si,si
  224.     jmp    short @1@478
  225. @1@366:
  226.    ;    
  227.    ;        {
  228.    ;            if (!_tasks[i].hTask)
  229.    ;    
  230.     ?debug    L 102
  231.     mov    bx,si
  232.     imul    bx,bx,74
  233.     cmp    word ptr DGROUP:__tasks[bx],0
  234.     jne    short @1@450
  235.    ;    
  236.    ;            {
  237.    ;                _tasks[i].hTask = hTask;
  238.    ;    
  239.     ?debug    L 104
  240.     mov    bx,si
  241.     imul    bx,bx,74
  242.     mov    ax,word ptr [bp-4]
  243.     mov    word ptr DGROUP:__tasks[bx],ax
  244.    ;    
  245.    ;                _tasks[i].pchCreatedBy = ((char **) &hTask)[2];
  246.    ;    
  247.     ?debug    L 105
  248.     mov    bx,si
  249.     imul    bx,bx,74
  250.     mov    dx,word ptr [bp+6]
  251.     mov    ax,word ptr [bp+4]
  252.     mov    word ptr DGROUP:__tasks[bx+68],dx
  253.     mov    word ptr DGROUP:__tasks[bx+66],ax
  254. @1@422:
  255.    ;    
  256.    ;                return &_tasks[i];
  257.    ;    
  258.     ?debug    L 106
  259.     mov    ax,si
  260.     imul    ax,ax,74
  261.     mov    dx,ds
  262.     add    ax,offset DGROUP:__tasks
  263.     jmp    short @1@534
  264. @1@450:
  265.     ?debug    L 100
  266.     inc    si
  267. @1@478:
  268.     cmp    si,20
  269.     jl    short @1@366
  270.    ;    
  271.    ;            }
  272.    ;        }
  273.    ;        return 0;
  274.    ;    
  275.     ?debug    L 109
  276.     xor    dx,dx
  277.     xor    ax,ax
  278.     jmp    short @1@534
  279. @1@534:
  280.    ;    
  281.    ;    }
  282.    ;    
  283.     ?debug    L 110
  284.     pop    si
  285.     pop    cx
  286.     pop    ds
  287.     pop    bp
  288.     dec    bp
  289.     ret    
  290.     ?debug    C E31907485441534B5F5F02001E01
  291.     ?debug    C E318000200151904
  292.     ?debug    C E60169040406000005685461736B1802FCFF0000
  293.     ?debug    E
  294.     ?debug    E
  295. _GetTaskInfo    endp
  296.    ;    
  297.    ;    inc_pid(short *pid)
  298.    ;    
  299.     ?debug    L 113
  300.     assume    cs:PROCESS_TEXT,ds:DGROUP
  301. _inc_pid    proc    far
  302.     ?debug    B
  303.     mov    ax,DGROUP
  304.     inc    bp
  305.     push    bp
  306.     mov    bp,sp
  307.     push    ds
  308.     mov    ds,ax
  309.     ?debug    C E31A000400160400
  310.     ?debug    C E6037069641A0A06000000
  311.     ?debug    B
  312.    ;    
  313.    ;    {
  314.    ;        if (*pid == 32767)
  315.    ;    
  316.     ?debug    L 115
  317.     les    bx,dword ptr [bp+6]
  318.     cmp    word ptr es:[bx],32767
  319.     jne    short @2@86
  320.    ;    
  321.    ;            *pid = 2;
  322.    ;    
  323.     ?debug    L 116
  324.     les    bx,dword ptr [bp+6]
  325.     mov    word ptr es:[bx],2
  326.     jmp    short @2@114
  327. @2@86:
  328.    ;    
  329.    ;        else
  330.    ;            (*pid)++;
  331.    ;    
  332.     ?debug    L 118
  333.     les    bx,dword ptr [bp+6]
  334.     inc    word ptr es:[bx]
  335. @2@114:
  336.    ;    
  337.    ;    }
  338.    ;    
  339.     ?debug    L 119
  340.     pop    ds
  341.     pop    bp
  342.     dec    bp
  343.     ret    
  344.     ?debug    C E6037069641A0A06000000
  345.     ?debug    E
  346.     ?debug    E
  347. _inc_pid    endp
  348. PROCESS_TEXT    ends
  349. _DATA    segment word public 'DATA'
  350. aiExecErrors    label    word
  351.     db    8
  352.     db    0
  353.     db    14
  354.     db    0
  355.     db    2
  356.     db    0
  357.     db    2
  358.     db    0
  359.     db    14
  360.     db    0
  361.     db    21
  362.     db    0
  363.     db    21
  364.     db    0
  365.     db    14
  366.     db    0
  367.     db    14
  368.     db    0
  369.     db    14
  370.     db    0
  371.     db    21
  372.     db    0
  373.     db    21
  374.     db    0
  375.     db    21
  376.     db    0
  377.     db    21
  378.     db    0
  379.     db    21
  380.     db    0
  381.     db    21
  382.     db    0
  383.     db    26
  384.     db    0
  385.     db    26
  386.     db    0
  387.     db    21
  388.     db    0
  389.     db    14
  390.     db    0
  391.     db    14
  392.     db    0
  393.     db    14
  394.     db    0
  395.     db    14
  396.     db    0
  397.     db    14
  398.     db    0
  399.     db    14
  400.     db    0
  401.     db    14
  402.     db    0
  403.     db    14
  404.     db    0
  405.     db    14
  406.     db    0
  407.     db    14
  408.     db    0
  409.     db    14
  410.     db    0
  411.     db    14
  412.     db    0
  413.     db    14
  414.     db    0
  415.     db    14
  416.     db    0
  417. _nTKExecIn    label    word
  418.     db    0
  419.     db    0
  420. _nTKExecOut    label    word
  421.     db    0
  422.     db    0
  423. _DATA    ends
  424. PROCESS_TEXT    segment word public 'CODE'
  425.    ;    
  426.    ;    tkern_exec(    char const    *pchPath,
  427.    ;    
  428.     ?debug    L 182
  429.     assume    cs:PROCESS_TEXT,ds:DGROUP
  430. _tkern_exec    proc    far
  431.     ?debug    B
  432.     mov    ax,DGROUP
  433.     inc    bp
  434.     push    bp
  435.     mov    bp,sp
  436.     push    ds
  437.     mov    ds,ax
  438.     sub    sp,10
  439.     ?debug    C E31B000400160200
  440.     ?debug    C E31C000400160100
  441.     ?debug    C E60A706368436D644C696E651B0A120000000576+
  442.     ?debug    C 61456E761C0A0E000000067661417267731C0A0A+
  443.     ?debug    C 00000007706368506174681B0A06000000
  444.     ?debug    B
  445.    ;    
  446.    ;            va_list        vaArgs,
  447.    ;            va_list        vaEnv,
  448.    ;            char const    *pchCmdLine)
  449.    ;    {
  450.    ;        struct    task *pt;
  451.    ;        char    *pchCommand;
  452.    ;        int    iNew;
  453.    ;    
  454.    ;        pt = GetTaskInfo();
  455.    ;    
  456.     ?debug    L 191
  457.     push    cs
  458.     call    near ptr _GetTaskInfo
  459.     mov    word ptr [bp-4],dx
  460.     mov    word ptr [bp-6],ax
  461.    ;    
  462.    ;        if (pt->nFlags & TF_EXEC)    /* Attempt to recursively exec */
  463.    ;    
  464.     ?debug    L 192
  465.     les    bx,dword ptr [bp-6]
  466.     test    byte ptr es:[bx+60],2
  467.     je    short @3@114
  468.    ;    
  469.    ;        {
  470.    ;            pt->nError = EAGAIN;
  471.    ;    
  472.     ?debug    L 194
  473.     les    bx,dword ptr [bp-6]
  474.     mov    word ptr es:[bx+62],42
  475.     jmp    @3@646
  476.     jmp    @3@646
  477. @3@114:
  478.    ;    
  479.    ;            return -1;
  480.    ;        }
  481.    ;        nTKExecIn++;
  482.    ;    
  483.     ?debug    L 197
  484.     inc    word ptr DGROUP:_nTKExecIn
  485.    ;    
  486.    ;        pt->nFlags |= TF_EXEC;
  487.    ;    
  488.     ?debug    L 198
  489.     les    bx,dword ptr [bp-6]
  490.     or    word ptr es:[bx+60],2
  491.    ;    
  492.    ;        Copy_Array(&pt->argv, (char **) vaArgs);
  493.    ;    
  494.     ?debug    L 199
  495.     push    word ptr [bp+12]
  496.     push    word ptr [bp+10]
  497.     mov    ax,word ptr [bp-6]
  498.     add    ax,52
  499.     push    word ptr [bp-4]
  500.     push    ax
  501.     call    far ptr _Copy_Array
  502.     add    sp,8
  503.    ;    
  504.    ;        Copy_Array(&pt->envp, (char **) vaEnv);
  505.    ;    
  506.     ?debug    L 200
  507.     push    word ptr [bp+16]
  508.     push    word ptr [bp+14]
  509.     mov    ax,word ptr [bp-6]
  510.     add    ax,56
  511.     push    word ptr [bp-4]
  512.     push    ax
  513.     call    far ptr _Copy_Array
  514.     add    sp,8
  515.    ;    
  516.    ;        pchCommand = (char *) malloc(strlen(pchPath) + strlen(pchCmdLine) + 2);
  517.    ;    
  518.     ?debug    L 201
  519.     push    word ptr [bp+8]
  520.     push    word ptr [bp+6]
  521.     call    far ptr _strlen
  522.     add    sp,4
  523.     push    ax
  524.     push    word ptr [bp+20]
  525.     push    word ptr [bp+18]
  526.     call    far ptr _strlen
  527.     add    sp,4
  528.     pop    dx
  529.     add    dx,ax
  530.     add    dx,2
  531.     push    dx
  532.     call    far ptr _malloc
  533.     pop    cx
  534.     mov    word ptr [bp-8],dx
  535.     mov    word ptr [bp-10],ax
  536.    ;    
  537.    ;        strcpy(pchCommand, pchPath);
  538.    ;    
  539.     ?debug    L 202
  540.     push    word ptr [bp+8]
  541.     push    word ptr [bp+6]
  542.     push    word ptr [bp-8]
  543.     push    word ptr [bp-10]
  544.     call    far ptr _strcpy
  545.     add    sp,8
  546.    ;    
  547.    ;        if (pchCmdLine)
  548.    ;    
  549.     ?debug    L 203
  550.     mov    ax,word ptr [bp+18]
  551.     or    ax,word ptr [bp+20]
  552.     je    short @3@170
  553.    ;    
  554.    ;        {
  555.    ;            strcat(pchCommand, " ");
  556.    ;    
  557.     ?debug    L 205
  558.     push    ds
  559.     push    offset DGROUP:s@
  560.     push    word ptr [bp-8]
  561.     push    word ptr [bp-10]
  562.     call    far ptr _strcat
  563.     add    sp,8
  564.    ;    
  565.    ;            strcat(pchCommand, pchCmdLine);
  566.    ;    
  567.     ?debug    L 206
  568.     push    word ptr [bp+20]
  569.     push    word ptr [bp+18]
  570.     push    word ptr [bp-8]
  571.     push    word ptr [bp-10]
  572.     call    far ptr _strcat
  573.     add    sp,8
  574. @3@170:
  575.     jmp    short @3@226
  576. @3@198:
  577.    ;    
  578.    ;        }
  579.    ;        while (ptNext)
  580.    ;            GetMessages(pt); /* We only allow one exec at any one time */
  581.    ;    
  582.     ?debug    L 209
  583.     push    word ptr [bp-4]
  584.     push    word ptr [bp-6]
  585.     call    far ptr _GetMessages
  586.     add    sp,4
  587. @3@226:
  588.     ?debug    L 208
  589.     mov    ax,word ptr DGROUP:ptNext
  590.     or    ax,word ptr DGROUP:ptNext+2
  591.     jne    short @3@198
  592.    ;    
  593.    ;        ptNext = pt;
  594.    ;    
  595.     ?debug    L 210
  596.     mov    dx,word ptr [bp-4]
  597.     mov    ax,word ptr [bp-6]
  598.     mov    word ptr DGROUP:ptNext+2,dx
  599.     mov    word ptr DGROUP:ptNext,ax
  600.    ;    
  601.    ;        ptLast = pt;
  602.    ;    
  603.     ?debug    L 211
  604.     mov    dx,word ptr [bp-4]
  605.     mov    ax,word ptr [bp-6]
  606.     mov    word ptr DGROUP:ptLast+2,dx
  607.     mov    word ptr DGROUP:ptLast,ax
  608.    ;    
  609.    ;        if (ptNext->files[0] == -1 ||
  610.    ;    
  611.     ?debug    L 212
  612.    ;    
  613.    ;            ptNext->files[1] == -1 ||
  614.    ;            ptNext->files[2] == -1)
  615.    ;    
  616.     ?debug    L 214
  617.     les    bx,dword ptr DGROUP:ptNext
  618.     cmp    word ptr es:[bx+12],-1
  619.     je    short @3@338
  620.     les    bx,dword ptr DGROUP:ptNext
  621.     cmp    word ptr es:[bx+14],-1
  622.     je    short @3@338
  623.     les    bx,dword ptr DGROUP:ptNext
  624.     cmp    word ptr es:[bx+16],-1
  625.     jne    short @3@366
  626. @3@338:
  627.    ;    
  628.    ;            MessageBox(0, "Files are all mixed up in exec", 0, MB_OK);
  629.    ;    
  630.     ?debug    L 215
  631.     push    0
  632.     push    ds
  633.     push    offset DGROUP:s@+2
  634.     push    0
  635.     push    0
  636.     push    0
  637.     call    far ptr MESSAGEBOX
  638. @3@366:
  639.    ;    
  640.    ;        if (pt->hTask != HTASK_FLEDGELING)
  641.    ;    
  642.     ?debug    L 216
  643.     les    bx,dword ptr [bp-6]
  644.     cmp    word ptr es:[bx],-1
  645.     je    short @3@422
  646.    ;    
  647.    ;            MessageBox(0, "Task is not a fledgeling", 0, MB_OK);
  648.    ;    
  649.     ?debug    L 217
  650.     push    0
  651.     push    ds
  652.     push    offset DGROUP:s@+33
  653.     push    0
  654.     push    0
  655.     push    0
  656.     call    far ptr MESSAGEBOX
  657. @3@422:
  658.    ;    
  659.    ;        if (!ptNext)
  660.    ;    
  661.     ?debug    L 218
  662.     mov    ax,word ptr DGROUP:ptNext
  663.     or    ax,word ptr DGROUP:ptNext+2
  664.     jne    short @3@478
  665.    ;    
  666.    ;            MessageBox(0, "I set a NULL ptNext!", 0, MB_OK);
  667.    ;    
  668.     ?debug    L 219
  669.     push    0
  670.     push    ds
  671.     push    offset DGROUP:s@+58
  672.     push    0
  673.     push    0
  674.     push    0
  675.     call    far ptr MESSAGEBOX
  676. @3@478:
  677.    ;    
  678.    ;        for (ptParent = pt;
  679.    ;    
  680.     ?debug    L 220
  681.     mov    dx,word ptr [bp-4]
  682.     mov    ax,word ptr [bp-6]
  683.     mov    word ptr DGROUP:ptParent+2,dx
  684.     jmp    short @3@534
  685. @3@506:
  686.    ;    
  687.    ;             ptParent->hTask == HTASK_FLEDGELING;
  688.    ;             ptParent = _tasks + ptParent->iParent);
  689.    ;    
  690.     ?debug    L 222
  691.     les    bx,dword ptr DGROUP:ptParent
  692.     mov    ax,word ptr es:[bx+6]
  693.     imul    ax,ax,74
  694.     add    ax,offset DGROUP:__tasks
  695.     mov    word ptr DGROUP:ptParent+2,ds
  696. @3@534:
  697.     mov    word ptr DGROUP:ptParent,ax
  698.     ?debug    L 221
  699.     les    bx,dword ptr DGROUP:ptParent
  700.     cmp    word ptr es:[bx],-1
  701.     je    short @3@506
  702.    ;    
  703.    ;        htaskParent = ptParent->hTask;
  704.    ;    
  705.     ?debug    L 223
  706.     les    bx,dword ptr DGROUP:ptParent
  707.     mov    ax,word ptr es:[bx]
  708.     mov    word ptr DGROUP:htaskParent,ax
  709.    ;    
  710.    ;        _tasks[pt->iParent].iFledgeling = -1;
  711.    ;    
  712.     ?debug    L 224
  713.     les    bx,dword ptr [bp-6]
  714.     mov    bx,word ptr es:[bx+6]
  715.     imul    bx,bx,74
  716.     mov    word ptr DGROUP:__tasks[bx+4],-1
  717.    ;    
  718.    ;        pt->iParent = 0;    /* We don't keep this because the parent
  719.    ;    
  720.     ?debug    L 225
  721.     les    bx,dword ptr [bp-6]
  722.     mov    word ptr es:[bx+6],0
  723.    ;    
  724.    ;                     * may die.
  725.    ;                     */
  726.    ;        pidParent = ptParent->pid;
  727.    ;    
  728.     ?debug    L 228
  729.     les    bx,dword ptr DGROUP:ptParent
  730.     mov    ax,word ptr es:[bx+2]
  731.     mov    word ptr DGROUP:pidParent,ax
  732.    ;    
  733.    ;        pidChild = 0;
  734.    ;    
  735.     ?debug    L 229
  736.     mov    word ptr DGROUP:pidChild,0
  737.    ;    
  738.    ;        if ((iNew = WinExec(pchCommand, SW_SHOW)) < 32)
  739.    ;    
  740.     ?debug    L 230
  741.     push    word ptr [bp-8]
  742.     push    word ptr [bp-10]
  743.     push    5
  744.     call    far ptr WINEXEC
  745.     mov    word ptr [bp-12],ax
  746.     cmp    ax,32
  747.     jl    @@0
  748.     jmp    @3@674
  749. @@0:
  750.    ;    
  751.    ;        {
  752.    ;            ptParent->nError = aiExecErrors[iNew];
  753.    ;    
  754.     ?debug    L 232
  755.     mov    bx,word ptr [bp-12]
  756.     add    bx,bx
  757.     mov    ax,word ptr DGROUP:aiExecErrors[bx]
  758.     les    bx,dword ptr DGROUP:ptParent
  759.     mov    word ptr es:[bx+62],ax
  760.    ;    
  761.    ;            ptParent->iFledgeling = -1;
  762.    ;    
  763.     ?debug    L 233
  764.     les    bx,dword ptr DGROUP:ptParent
  765.     mov    word ptr es:[bx+4],-1
  766.    ;    
  767.    ;            ptNext = 0;
  768.    ;    
  769.     ?debug    L 234
  770.     mov    word ptr DGROUP:ptNext+2,0
  771.     mov    word ptr DGROUP:ptNext,0
  772.    ;    
  773.    ;            task_is_dead(pt - _tasks);
  774.    ;    
  775.     ?debug    L 235
  776.     push    0
  777.     push    74
  778.     mov    ax,word ptr [bp-6]
  779.     xor    dx,dx
  780.     sub    ax,offset DGROUP:__tasks
  781.     sbb    dx,0
  782.     push    dx
  783.     push    ax
  784.     call    far ptr F_LDIV@
  785.     push    ax
  786.     call    far ptr task_is_dead
  787.     pop    cx
  788.    ;    
  789.    ;            htaskParent = 0;
  790.    ;    
  791.     ?debug    L 236
  792.     mov    word ptr DGROUP:htaskParent,0
  793.    ;    
  794.    ;            pt->nFlags &= ~TF_EXEC;
  795.    ;    
  796.     ?debug    L 237
  797.     les    bx,dword ptr [bp-6]
  798.     and    word ptr es:[bx+60],-3
  799.    ;    
  800.    ;            pt->nError = ENOENT;
  801.    ;    
  802.     ?debug    L 238
  803.     les    bx,dword ptr [bp-6]
  804.     mov    word ptr es:[bx+62],2
  805.    ;    
  806.    ;            tkern_wakeup_call();
  807.    ;    
  808.     ?debug    L 239
  809.     call    far ptr _tkern_wakeup_call
  810.    ;    
  811.    ;            MessageBox(0, "WinExec returned an error", 0, MB_OK);
  812.    ;    
  813.     ?debug    L 240
  814.     push    0
  815.     push    ds
  816.     push    offset DGROUP:s@+79
  817.     push    0
  818.     push    0
  819.     push    0
  820.     call    far ptr MESSAGEBOX
  821.    ;    
  822.    ;            nTKExecOut++;
  823.    ;    
  824.     ?debug    L 241
  825.     inc    word ptr DGROUP:_nTKExecOut
  826. @3@646:
  827.    ;    
  828.    ;            return -1;
  829.    ;    
  830.     ?debug    L 242
  831.     mov    ax,-1
  832.     jmp    @3@1010
  833. @3@674:
  834.    ;    
  835.    ;        }
  836.    ;        free(pchCommand);
  837.    ;    
  838.     ?debug    L 244
  839.     push    word ptr [bp-8]
  840.     push    word ptr [bp-10]
  841.     call    far ptr _free
  842.     add    sp,4
  843.    ;    
  844.    ;        if (ptNext != pt)
  845.    ;    
  846.     ?debug    L 245
  847.     mov    dx,word ptr DGROUP:ptNext+2
  848.     mov    ax,word ptr DGROUP:ptNext
  849.     cmp    dx,word ptr [bp-4]
  850.     jne    short @3@730
  851.     cmp    ax,word ptr [bp-6]
  852.     je    short @3@758
  853. @3@730:
  854.    ;    
  855.    ;            MessageBox(0, "ptNext has been tampered with (!= pt)", 0, MB_OK);
  856.    ;    
  857.     ?debug    L 246
  858.     push    0
  859.     push    ds
  860.     push    offset DGROUP:s@+105
  861.     push    0
  862.     push    0
  863.     push    0
  864.     call    far ptr MESSAGEBOX
  865. @3@758:
  866.    ;    
  867.    ;        if (ptNext != ptLast)
  868.    ;    
  869.     ?debug    L 247
  870.     mov    dx,word ptr DGROUP:ptNext+2
  871.     mov    ax,word ptr DGROUP:ptNext
  872.     cmp    dx,word ptr DGROUP:ptLast+2
  873.     jne    short @3@814
  874.     cmp    ax,word ptr DGROUP:ptLast
  875.     je    short @3@842
  876. @3@814:
  877.    ;    
  878.    ;            MessageBox(0, "ptNext does not match ptLast in tkexec", 0, MB_OK);
  879.    ;    
  880.     ?debug    L 248
  881.     push    0
  882.     push    ds
  883.     push    offset DGROUP:s@+143
  884.     push    0
  885.     push    0
  886.     push    0
  887.     call    far ptr MESSAGEBOX
  888. @3@842:
  889.    ;    
  890.    ;        ptParent->nChildren++;
  891.    ;    
  892.     ?debug    L 249
  893.     les    bx,dword ptr DGROUP:ptParent
  894.     inc    word ptr es:[bx+8]
  895.    ;    
  896.    ;        ptNext = 0;
  897.    ;    
  898.     ?debug    L 250
  899.     mov    word ptr DGROUP:ptNext+2,0
  900.     mov    word ptr DGROUP:ptNext,0
  901.    ;    
  902.    ;        htaskParent = 0;
  903.    ;    
  904.     ?debug    L 251
  905.     mov    word ptr DGROUP:htaskParent,0
  906.    ;    
  907.    ;        tkern_wakeup_call();
  908.    ;    
  909.     ?debug    L 252
  910.     call    far ptr _tkern_wakeup_call
  911.    ;    
  912.    ;        pt->nFlags &= ~TF_EXEC;
  913.    ;    
  914.     ?debug    L 253
  915.     les    bx,dword ptr [bp-6]
  916.     and    word ptr es:[bx+60],-3
  917.    ;    
  918.    ;        if (pt->hTask == HTASK_FLEDGELING)
  919.    ;    
  920.     ?debug    L 254
  921.     les    bx,dword ptr [bp-6]
  922.     cmp    word ptr es:[bx],-1
  923.     jne    short @3@898
  924.    ;    
  925.    ;        {
  926.    ;            MessageBox(0, "Task has not registered", 0, MB_OK);
  927.    ;    
  928.     ?debug    L 256
  929.     push    0
  930.     push    ds
  931.     push    offset DGROUP:s@+182
  932.     push    0
  933.     push    0
  934.     push    0
  935.     call    far ptr MESSAGEBOX
  936.    ;    
  937.    ;            ptParent->iFledgeling = -1;
  938.    ;    
  939.     ?debug    L 257
  940.     les    bx,dword ptr DGROUP:ptParent
  941.     mov    word ptr es:[bx+4],-1
  942.    ;    
  943.    ;            task_is_dead(pt - _tasks);
  944.    ;    
  945.     ?debug    L 258
  946.     push    0
  947.     push    74
  948.     mov    ax,word ptr [bp-6]
  949.     xor    dx,dx
  950.     sub    ax,offset DGROUP:__tasks
  951.     sbb    dx,0
  952.     push    dx
  953.     push    ax
  954.     call    far ptr F_LDIV@
  955.     push    ax
  956.     call    far ptr task_is_dead
  957.     pop    cx
  958.    ;    
  959.    ;        }
  960.    ;    
  961.     ?debug    L 259
  962.     jmp    short @3@954
  963. @3@898:
  964.    ;    
  965.    ;        else if (pt->hTask == 0)
  966.    ;    
  967.     ?debug    L 260
  968.     les    bx,dword ptr [bp-6]
  969.     cmp    word ptr es:[bx],0
  970.     jne    short @3@954
  971.    ;    
  972.    ;        {
  973.    ;            MessageBox(0, "Task entry has null hTask", 0, MB_OK);
  974.    ;    
  975.     ?debug    L 262
  976.     push    0
  977.     push    ds
  978.     push    offset DGROUP:s@+206
  979.     push    0
  980.     push    0
  981.     push    0
  982.     call    far ptr MESSAGEBOX
  983. @3@954:
  984.    ;    
  985.    ;        }
  986.    ;        nTKExecOut++;
  987.    ;    
  988.     ?debug    L 264
  989.     inc    word ptr DGROUP:_nTKExecOut
  990.    ;    
  991.    ;        return pidChild;
  992.    ;    
  993.     ?debug    L 265
  994.     mov    ax,word ptr DGROUP:pidChild
  995.     jmp    short @3@1010
  996. @3@1010:
  997.    ;    
  998.    ;    }
  999.    ;    
  1000.     ?debug    L 266
  1001.     lea    sp,word ptr [bp-2]
  1002.     pop    ds
  1003.     pop    bp
  1004.     dec    bp
  1005.     ret    
  1006.     ?debug    C E31D000400160200
  1007.     ?debug    C E31F047461736B4A001E03
  1008.     ?debug    C E3200028001A04
  1009.     ?debug    C E321000400161D00
  1010.     ?debug    C E32300000023010500
  1011.     ?debug    C E322000400162300
  1012.     ?debug    C E31E000400161F00
  1013.     ?debug    C E604694E65770402F4FF00000A706368436F6D6D+
  1014.     ?debug    C 616E641D02F6FF00000270741E02FAFF00000770+
  1015.     ?debug    C 6368506174681B0A06000000067661417267731C+
  1016.     ?debug    C 0A0A000000057661456E761C0A0E0000000A7063+
  1017.     ?debug    C 68436D644C696E651B0A12000000
  1018.     ?debug    E
  1019.     ?debug    E
  1020. _tkern_exec    endp
  1021.    ;    
  1022.    ;    tkern_wait(union wait *wstatus)
  1023.    ;    
  1024.     ?debug    L 286
  1025.     assume    cs:PROCESS_TEXT,ds:DGROUP
  1026. _tkern_wait    proc    far
  1027.     ?debug    B
  1028.     mov    ax,DGROUP
  1029.     inc    bp
  1030.     push    bp
  1031.     mov    bp,sp
  1032.     push    ds
  1033.     mov    ds,ax
  1034.     sub    sp,10
  1035.     push    si
  1036.     ?debug    C E325047761697404001F12
  1037.     ?debug    C E3260004001E16
  1038.     ?debug    C E3270004001E1B
  1039.     ?debug    C E324000400162500
  1040.     ?debug    C E60777737461747573240A06000000
  1041.     ?debug    B
  1042.    ;    
  1043.    ;    {
  1044.    ;        int    i;
  1045.    ;        short    pid;
  1046.    ;    
  1047.    ;        struct task *pt;
  1048.    ;        struct task *ptParent;
  1049.    ;    
  1050.    ;        pt = GetTaskInfo();
  1051.    ;    
  1052.     ?debug    L 294
  1053.     push    cs
  1054.     call    near ptr _GetTaskInfo
  1055.     mov    word ptr [bp-6],dx
  1056.     mov    word ptr [bp-8],ax
  1057.    ;    
  1058.    ;    
  1059.    ;        /* Fledgelings cannot be parents */
  1060.    ;        for (ptParent = pt;
  1061.    ;    
  1062.     ?debug    L 297
  1063.     mov    dx,word ptr [bp-6]
  1064.     mov    ax,word ptr [bp-8]
  1065.     mov    word ptr [bp-10],dx
  1066.     jmp    short @4@86
  1067. @4@58:
  1068.    ;    
  1069.    ;             ptParent->hTask == HTASK_FLEDGELING;
  1070.    ;             ptParent = _tasks + ptParent->iParent);
  1071.    ;    
  1072.     ?debug    L 299
  1073.     les    bx,dword ptr [bp-12]
  1074.     mov    ax,word ptr es:[bx+6]
  1075.     imul    ax,ax,74
  1076.     add    ax,offset DGROUP:__tasks
  1077.     mov    word ptr [bp-10],ds
  1078. @4@86:
  1079.     mov    word ptr [bp-12],ax
  1080.     ?debug    L 298
  1081.     les    bx,dword ptr [bp-12]
  1082.     cmp    word ptr es:[bx],-1
  1083.     je    short @4@58
  1084.    ;    
  1085.    ;    
  1086.    ;        /* If the parent is childless, return immediately */
  1087.    ;        if (!ptParent->nChildren)
  1088.    ;    
  1089.     ?debug    L 302
  1090.     les    bx,dword ptr [bp-12]
  1091.     cmp    word ptr es:[bx+8],0
  1092.     jne    short @4@198
  1093.     jmp    @4@506
  1094. @4@198:
  1095.     jmp    short @4@254
  1096. @4@226:
  1097.    ;    
  1098.    ;            return 0;
  1099.    ;    
  1100.    ;        /* Wait until the parent has dead children */
  1101.    ;        while (!ptParent->nZombies)
  1102.    ;            GetMessages(pt);
  1103.    ;    
  1104.     ?debug    L 307
  1105.     push    word ptr [bp-6]
  1106.     push    word ptr [bp-8]
  1107.     call    far ptr _GetMessages
  1108.     add    sp,4
  1109. @4@254:
  1110.     ?debug    L 306
  1111.     les    bx,dword ptr [bp-12]
  1112.     cmp    word ptr es:[bx+10],0
  1113.     je    short @4@226
  1114.    ;    
  1115.    ;    
  1116.    ;        /* Reap the first dead child we encounter and return its pid */
  1117.    ;        for (i = 0; i < nZombies; i++)
  1118.    ;    
  1119.     ?debug    L 310
  1120.     xor    si,si
  1121.     jmp    @4@478
  1122. @4@310:
  1123.    ;    
  1124.    ;        {
  1125.    ;            if (_zombies[i].pidParent == ptParent->pid)
  1126.    ;    
  1127.     ?debug    L 312
  1128.     mov    bx,si
  1129.     imul    bx,bx,12
  1130.     mov    ax,word ptr DGROUP:__zombies[bx+2]
  1131.     les    bx,dword ptr [bp-12]
  1132.     cmp    ax,word ptr es:[bx+2]
  1133.     jne    short @4@450
  1134.    ;    
  1135.    ;            {
  1136.    ;                pid = _zombies[i].pid;
  1137.    ;    
  1138.     ?debug    L 314
  1139.     mov    bx,si
  1140.     imul    bx,bx,12
  1141.     mov    ax,word ptr DGROUP:__zombies[bx]
  1142.     mov    word ptr [bp-4],ax
  1143.    ;    
  1144.    ;                wstatus->w_status = 0;
  1145.    ;    
  1146.     ?debug    L 315
  1147.     les    bx,dword ptr [bp+6]
  1148.     mov    word ptr es:[bx+2],0
  1149.     mov    word ptr es:[bx],0
  1150.    ;    
  1151.    ;                wstatus->w_retcode = _zombies[i].nRetCode;
  1152.    ;    
  1153.     ?debug    L 316
  1154.     mov    bx,si
  1155.     imul    bx,bx,12
  1156.     mov    al,byte ptr DGROUP:__zombies[bx+10]
  1157.     and    ax,255
  1158.     les    bx,dword ptr [bp+6]
  1159.     and    byte ptr es:[bx+2],0
  1160.     or    byte ptr es:[bx+2],al
  1161.    ;    
  1162.    ;                if (i < nZombies - 1)
  1163.    ;    
  1164.     ?debug    L 317
  1165.     mov    ax,word ptr DGROUP:nZombies
  1166.     dec    ax
  1167.     cmp    ax,si
  1168.     jle    short @4@394
  1169.    ;    
  1170.    ;                    _zombies[i] = _zombies[nZombies - 1];
  1171.    ;    
  1172.     ?debug    L 318
  1173.     mov    ax,si
  1174.     imul    ax,ax,12
  1175.     add    ax,offset DGROUP:__zombies
  1176.     push    ds
  1177.     push    ax
  1178.     mov    ax,word ptr DGROUP:nZombies
  1179.     imul    ax,ax,12
  1180.     add    ax,offset DGROUP:__zombies-12
  1181.     push    ds
  1182.     push    ax
  1183.     mov    cx,12
  1184.     call    far ptr F_SCOPY@
  1185. @4@394:
  1186.    ;    
  1187.    ;                nZombies--;
  1188.    ;    
  1189.     ?debug    L 319
  1190.     dec    word ptr DGROUP:nZombies
  1191.    ;    
  1192.    ;                ptParent->nZombies--;
  1193.    ;    
  1194.     ?debug    L 320
  1195.     les    bx,dword ptr [bp-12]
  1196.     dec    word ptr es:[bx+10]
  1197.    ;    
  1198.    ;                ptParent->nChildren--;
  1199.    ;    
  1200.     ?debug    L 321
  1201.     les    bx,dword ptr [bp-12]
  1202.     dec    word ptr es:[bx+8]
  1203.    ;    
  1204.    ;                return pid;
  1205.    ;    
  1206.     ?debug    L 322
  1207.     mov    ax,word ptr [bp-4]
  1208.     jmp    short @4@534
  1209. @4@450:
  1210.     ?debug    L 310
  1211.     inc    si
  1212. @4@478:
  1213.     cmp    si,word ptr DGROUP:nZombies
  1214.     jge    @@1
  1215.     jmp    @4@310
  1216. @@1:
  1217. @4@506:
  1218.    ;    
  1219.    ;            }
  1220.    ;        }
  1221.    ;        return 0;
  1222.    ;    
  1223.     ?debug    L 325
  1224.     xor    ax,ax
  1225.     jmp    short @4@534
  1226. @4@534:
  1227.    ;    
  1228.    ;    }
  1229.    ;    
  1230.     ?debug    L 326
  1231.     pop    si
  1232.     lea    sp,word ptr [bp-2]
  1233.     pop    ds
  1234.     pop    bp
  1235.     dec    bp
  1236.     ret    
  1237.     ?debug    C E6087074506172656E741E02F4FF00000270741E+
  1238.     ?debug    C 02F8FF0000037069640402FCFF00000169040406+
  1239.     ?debug    C 00000777737461747573240A06000000
  1240.     ?debug    E
  1241.     ?debug    E
  1242. _tkern_wait    endp
  1243.    ;    
  1244.    ;    tkern_wait3(union wait *wstatus,
  1245.    ;    
  1246.     ?debug    L 333
  1247.     assume    cs:PROCESS_TEXT,ds:DGROUP
  1248. _tkern_wait3    proc    far
  1249.     ?debug    B
  1250.     mov    ax,DGROUP
  1251.     inc    bp
  1252.     push    bp
  1253.     mov    bp,sp
  1254.     push    ds
  1255.     mov    ds,ax
  1256.     sub    sp,10
  1257.     push    si
  1258.     ?debug    C E3290672757361676502001E20
  1259.     ?debug    C E328000400162900
  1260.     ?debug    C E605705A65726F280A0C000000066E466C616773+
  1261.     ?debug    C 040A0A0000000777737461747573240A06000000
  1262.     ?debug    B
  1263.    ;    
  1264.    ;            int    nFlags,
  1265.    ;            struct rusage *pZero)
  1266.    ;    {
  1267.    ;        int    i;
  1268.    ;        short    pid;
  1269.    ;        struct task *pt;
  1270.    ;        struct task *ptParent;
  1271.    ;    
  1272.    ;        pt = GetTaskInfo();
  1273.    ;    
  1274.     ?debug    L 342
  1275.     push    cs
  1276.     call    near ptr _GetTaskInfo
  1277.     mov    word ptr [bp-6],dx
  1278.     mov    word ptr [bp-8],ax
  1279.    ;    
  1280.    ;    
  1281.    ;        if (pZero)
  1282.    ;    
  1283.     ?debug    L 344
  1284.     mov    ax,word ptr [bp+12]
  1285.     or    ax,word ptr [bp+14]
  1286.     je    short @5@114
  1287.    ;    
  1288.    ;        {
  1289.    ;            pt->nError = EINVAL;
  1290.    ;    
  1291.     ?debug    L 346
  1292.     les    bx,dword ptr [bp-8]
  1293.     mov    word ptr es:[bx+62],19
  1294.    ;    
  1295.    ;            return -1;
  1296.    ;    
  1297.     ?debug    L 347
  1298.     mov    ax,-1
  1299.     jmp    @5@702
  1300. @5@114:
  1301.    ;    
  1302.    ;        }
  1303.    ;    
  1304.    ;        /* Fledgelings cannot be parents */
  1305.    ;        for (ptParent = pt;
  1306.    ;    
  1307.     ?debug    L 351
  1308.     mov    dx,word ptr [bp-6]
  1309.     mov    ax,word ptr [bp-8]
  1310.     mov    word ptr [bp-10],dx
  1311.     jmp    short @5@170
  1312. @5@142:
  1313.    ;    
  1314.    ;             ptParent->hTask == HTASK_FLEDGELING;
  1315.    ;             ptParent = _tasks + ptParent->iParent);
  1316.    ;    
  1317.     ?debug    L 353
  1318.     les    bx,dword ptr [bp-12]
  1319.     mov    ax,word ptr es:[bx+6]
  1320.     imul    ax,ax,74
  1321.     add    ax,offset DGROUP:__tasks
  1322.     mov    word ptr [bp-10],ds
  1323. @5@170:
  1324.     mov    word ptr [bp-12],ax
  1325.     ?debug    L 352
  1326.     les    bx,dword ptr [bp-12]
  1327.     cmp    word ptr es:[bx],-1
  1328.     je    short @5@142
  1329.    ;    
  1330.    ;    
  1331.    ;        /* If the parent is childless, return immediately */
  1332.    ;        if (!ptParent->nChildren)
  1333.    ;    
  1334.     ?debug    L 356
  1335.     les    bx,dword ptr [bp-12]
  1336.     cmp    word ptr es:[bx+8],0
  1337.     jne    short @5@282
  1338.    ;    
  1339.    ;            return 0;
  1340.    ;    
  1341.     ?debug    L 357
  1342.     jmp    @5@674
  1343. @5@282:
  1344.    ;    
  1345.    ;    
  1346.    ;        /* If the WNOHANG flag is supplied, and there are no
  1347.    ;         * zombies, return immediately
  1348.    ;         */
  1349.    ;        if (!ptParent->nZombies && (nFlags & WNOHANG))
  1350.    ;    
  1351.     ?debug    L 362
  1352.     les    bx,dword ptr [bp-12]
  1353.     cmp    word ptr es:[bx+10],0
  1354.     jne    short @5@366
  1355.     test    byte ptr [bp+10],1
  1356.     je    short @5@366
  1357.     jmp    @5@674
  1358. @5@366:
  1359.     jmp    short @5@422
  1360. @5@394:
  1361.    ;    
  1362.    ;            return 0;
  1363.    ;    
  1364.    ;        /* Since we don't have BSD jobs, we can't use WUNTRACED */
  1365.    ;    
  1366.    ;        /* Wait until the parent has dead children */
  1367.    ;        while (!ptParent->nZombies)
  1368.    ;            GetMessages(pt);
  1369.    ;    
  1370.     ?debug    L 369
  1371.     push    word ptr [bp-6]
  1372.     push    word ptr [bp-8]
  1373.     call    far ptr _GetMessages
  1374.     add    sp,4
  1375. @5@422:
  1376.     ?debug    L 368
  1377.     les    bx,dword ptr [bp-12]
  1378.     cmp    word ptr es:[bx+10],0
  1379.     je    short @5@394
  1380.    ;    
  1381.    ;    
  1382.    ;        /* Reap the first dead child we encounter and return its pid */
  1383.    ;        for (i = 0; i < nZombies; i++)
  1384.    ;    
  1385.     ?debug    L 372
  1386.     xor    si,si
  1387.     jmp    @5@646
  1388. @5@478:
  1389.    ;    
  1390.    ;        {
  1391.    ;            if (_zombies[i].pidParent == ptParent->pid)
  1392.    ;    
  1393.     ?debug    L 374
  1394.     mov    bx,si
  1395.     imul    bx,bx,12
  1396.     mov    ax,word ptr DGROUP:__zombies[bx+2]
  1397.     les    bx,dword ptr [bp-12]
  1398.     cmp    ax,word ptr es:[bx+2]
  1399.     jne    short @5@618
  1400.    ;    
  1401.    ;            {
  1402.    ;                pid = _zombies[i].pid;
  1403.    ;    
  1404.     ?debug    L 376
  1405.     mov    bx,si
  1406.     imul    bx,bx,12
  1407.     mov    ax,word ptr DGROUP:__zombies[bx]
  1408.     mov    word ptr [bp-4],ax
  1409.    ;    
  1410.    ;                wstatus->w_status = 0;
  1411.    ;    
  1412.     ?debug    L 377
  1413.     les    bx,dword ptr [bp+6]
  1414.     mov    word ptr es:[bx+2],0
  1415.     mov    word ptr es:[bx],0
  1416.    ;    
  1417.    ;                wstatus->w_retcode = _zombies[i].nRetCode;
  1418.    ;    
  1419.     ?debug    L 378
  1420.     mov    bx,si
  1421.     imul    bx,bx,12
  1422.     mov    al,byte ptr DGROUP:__zombies[bx+10]
  1423.     and    ax,255
  1424.     les    bx,dword ptr [bp+6]
  1425.     and    byte ptr es:[bx+2],0
  1426.     or    byte ptr es:[bx+2],al
  1427.    ;    
  1428.    ;                if (i < nZombies - 1)
  1429.    ;    
  1430.     ?debug    L 379
  1431.     mov    ax,word ptr DGROUP:nZombies
  1432.     dec    ax
  1433.     cmp    ax,si
  1434.     jle    short @5@562
  1435.    ;    
  1436.    ;                    _zombies[i] = _zombies[nZombies - 1];
  1437.    ;    
  1438.     ?debug    L 380
  1439.     mov    ax,si
  1440.     imul    ax,ax,12
  1441.     add    ax,offset DGROUP:__zombies
  1442.     push    ds
  1443.     push    ax
  1444.     mov    ax,word ptr DGROUP:nZombies
  1445.     imul    ax,ax,12
  1446.     add    ax,offset DGROUP:__zombies-12
  1447.     push    ds
  1448.     push    ax
  1449.     mov    cx,12
  1450.     call    far ptr F_SCOPY@
  1451. @5@562:
  1452.    ;    
  1453.    ;                nZombies--;
  1454.    ;    
  1455.     ?debug    L 381
  1456.     dec    word ptr DGROUP:nZombies
  1457.    ;    
  1458.    ;                ptParent->nZombies--;
  1459.    ;    
  1460.     ?debug    L 382
  1461.     les    bx,dword ptr [bp-12]
  1462.     dec    word ptr es:[bx+10]
  1463.    ;    
  1464.    ;                ptParent->nChildren--;
  1465.    ;    
  1466.     ?debug    L 383
  1467.     les    bx,dword ptr [bp-12]
  1468.     dec    word ptr es:[bx+8]
  1469.    ;    
  1470.    ;                return pid;
  1471.    ;    
  1472.     ?debug    L 384
  1473.     mov    ax,word ptr [bp-4]
  1474.     jmp    short @5@702
  1475. @5@618:
  1476.     ?debug    L 372
  1477.     inc    si
  1478. @5@646:
  1479.     cmp    si,word ptr DGROUP:nZombies
  1480.     jge    @@2
  1481.     jmp    @5@478
  1482. @@2:
  1483. @5@674:
  1484.    ;    
  1485.    ;            }
  1486.    ;        }
  1487.    ;        return 0;
  1488.    ;    
  1489.     ?debug    L 387
  1490.     xor    ax,ax
  1491.     jmp    short @5@702
  1492. @5@702:
  1493.    ;    
  1494.    ;    }
  1495.    ;    
  1496.     ?debug    L 388
  1497.     pop    si
  1498.     lea    sp,word ptr [bp-2]
  1499.     pop    ds
  1500.     pop    bp
  1501.     dec    bp
  1502.     ret    
  1503.     ?debug    C E6087074506172656E741E02F4FF00000270741E+
  1504.     ?debug    C 02F8FF0000037069640402FCFF00000169040406+
  1505.     ?debug    C 00000777737461747573240A06000000066E466C+
  1506.     ?debug    C 616773040A0A00000005705A65726F280A0C0000+
  1507.     ?debug    C 00
  1508.     ?debug    E
  1509.     ?debug    E
  1510. _tkern_wait3    endp
  1511.    ;    
  1512.    ;    tkern_waitpid(    int    pid,
  1513.    ;    
  1514.     ?debug    L 395
  1515.     assume    cs:PROCESS_TEXT,ds:DGROUP
  1516. _tkern_waitpid    proc    far
  1517.     ?debug    B
  1518.     mov    ax,DGROUP
  1519.     inc    bp
  1520.     push    bp
  1521.     mov    bp,sp
  1522.     push    ds
  1523.     mov    ds,ax
  1524.     sub    sp,16
  1525.     push    si
  1526.     push    di
  1527.     ?debug    C E6066E466C616773040A0C000000077773746174+
  1528.     ?debug    C 7573240A0800000003706964040A06000000
  1529.     ?debug    B
  1530.    ;    
  1531.    ;            union wait *wstatus,
  1532.    ;            int    nFlags)
  1533.    ;    {
  1534.    ;        int    i;
  1535.    ;        struct task *pt;
  1536.    ;        struct task *ptParent;
  1537.    ;        BOOL    bZombie;
  1538.    ;        int    iEntry;
  1539.    ;        struct tk_process *pProc;
  1540.    ;        int    nLastZombies = -1;
  1541.    ;    
  1542.     ?debug    L 405
  1543.     mov    word ptr [bp-18],-1
  1544.    ;    
  1545.    ;    
  1546.    ;        pt = GetTaskInfo();
  1547.    ;    
  1548.     ?debug    L 407
  1549.     push    cs
  1550.     call    near ptr _GetTaskInfo
  1551.     mov    word ptr [bp-4],dx
  1552.     mov    word ptr [bp-6],ax
  1553.    ;    
  1554.    ;    
  1555.    ;        /* Fledgelings cannot be parents */
  1556.    ;        for (ptParent = pt;
  1557.    ;    
  1558.     ?debug    L 410
  1559.     mov    dx,word ptr [bp-4]
  1560.     mov    ax,word ptr [bp-6]
  1561.     mov    word ptr [bp-8],dx
  1562.     jmp    short @6@86
  1563. @6@58:
  1564.    ;    
  1565.    ;             ptParent->hTask == HTASK_FLEDGELING;
  1566.    ;             ptParent = _tasks + ptParent->iParent);
  1567.    ;    
  1568.     ?debug    L 412
  1569.     les    bx,dword ptr [bp-10]
  1570.     mov    ax,word ptr es:[bx+6]
  1571.     imul    ax,ax,74
  1572.     add    ax,offset DGROUP:__tasks
  1573.     mov    word ptr [bp-8],ds
  1574. @6@86:
  1575.     mov    word ptr [bp-10],ax
  1576.     ?debug    L 411
  1577.     les    bx,dword ptr [bp-10]
  1578.     cmp    word ptr es:[bx],-1
  1579.     je    short @6@58
  1580.    ;    
  1581.    ;    
  1582.    ;        /* If the parent is childless, return immediately */
  1583.    ;        if (!ptParent->nChildren)
  1584.    ;    
  1585.     ?debug    L 415
  1586.     les    bx,dword ptr [bp-10]
  1587.     cmp    word ptr es:[bx+8],0
  1588.     jne    short @6@198
  1589.    ;    
  1590.    ;            return 0;
  1591.    ;    
  1592.     ?debug    L 416
  1593.     jmp    @6@1402
  1594. @6@198:
  1595.    ;    
  1596.    ;    
  1597.    ;        while (1)
  1598.    ;        {
  1599.    ;            /* Find the process entry for this child */
  1600.    ;            if (pid)
  1601.    ;    
  1602.     ?debug    L 421
  1603.     cmp    word ptr [bp+6],0
  1604.     jne    @@3
  1605.     jmp    @6@1094
  1606. @@3:
  1607.    ;    
  1608.    ;            {
  1609.    ;                if (ptParent->nZombies != nLastZombies)
  1610.    ;    
  1611.     ?debug    L 423
  1612.     les    bx,dword ptr [bp-10]
  1613.     mov    ax,word ptr es:[bx+10]
  1614.     cmp    ax,word ptr [bp-18]
  1615.     jne    @@4
  1616.     jmp    @6@982
  1617. @@4:
  1618.    ;    
  1619.    ;                {
  1620.    ;                    iEntry = -1;
  1621.    ;    
  1622.     ?debug    L 425
  1623.     mov    di,-1
  1624.    ;    
  1625.    ;                    for (i = 0;  iEntry == -1 && i < nProcesses; i++)
  1626.    ;    
  1627.     ?debug    L 426
  1628.     xor    si,si
  1629.     jmp    short @6@366
  1630. @6@282:
  1631.    ;    
  1632.    ;                    {
  1633.    ;                        if (_process[i].pid == pid)
  1634.    ;    
  1635.     ?debug    L 428
  1636.     mov    bx,si
  1637.     imul    bx,bx,12
  1638.     mov    ax,word ptr DGROUP:__process[bx]
  1639.     cmp    ax,word ptr [bp+6]
  1640.     jne    short @6@338
  1641.    ;    
  1642.    ;                        {
  1643.    ;                            iEntry = i;
  1644.    ;    
  1645.     ?debug    L 430
  1646.     mov    di,si
  1647.    ;    
  1648.    ;                            bZombie = FALSE;
  1649.    ;    
  1650.     ?debug    L 431
  1651.     mov    word ptr [bp-12],0
  1652.    ;    
  1653.    ;                            pProc = &_process[i];
  1654.    ;    
  1655.     ?debug    L 432
  1656.     mov    ax,si
  1657.     imul    ax,ax,12
  1658.     add    ax,offset DGROUP:__process
  1659.     mov    word ptr [bp-14],ds
  1660.     mov    word ptr [bp-16],ax
  1661. @6@338:
  1662.     ?debug    L 426
  1663.     inc    si
  1664. @6@366:
  1665.     cmp    di,-1
  1666.     jne    short @6@422
  1667.     cmp    si,word ptr DGROUP:nProcesses
  1668.     jl    short @6@282
  1669. @6@422:
  1670.    ;    
  1671.    ;                        }
  1672.    ;                    }
  1673.    ;                    for (i = 0; iEntry == -1 && i < nZombies; i++)
  1674.    ;    
  1675.     ?debug    L 435
  1676.     xor    si,si
  1677.     jmp    short @6@534
  1678. @6@450:
  1679.    ;    
  1680.    ;                    {
  1681.    ;                        if (_zombies[i].pid == pid)
  1682.    ;    
  1683.     ?debug    L 437
  1684.     mov    bx,si
  1685.     imul    bx,bx,12
  1686.     mov    ax,word ptr DGROUP:__zombies[bx]
  1687.     cmp    ax,word ptr [bp+6]
  1688.     jne    short @6@506
  1689.    ;    
  1690.    ;                        {
  1691.    ;                            iEntry = i;
  1692.    ;    
  1693.     ?debug    L 439
  1694.     mov    di,si
  1695.    ;    
  1696.    ;                            bZombie = TRUE;
  1697.    ;    
  1698.     ?debug    L 440
  1699.     mov    word ptr [bp-12],1
  1700.    ;    
  1701.    ;                            pProc = &_zombies[i];
  1702.    ;    
  1703.     ?debug    L 441
  1704.     mov    ax,si
  1705.     imul    ax,ax,12
  1706.     add    ax,offset DGROUP:__zombies
  1707.     mov    word ptr [bp-14],ds
  1708.     mov    word ptr [bp-16],ax
  1709. @6@506:
  1710.     ?debug    L 435
  1711.     inc    si
  1712. @6@534:
  1713.     cmp    di,-1
  1714.     jne    short @6@590
  1715.     cmp    si,word ptr DGROUP:nZombies
  1716.     jl    short @6@450
  1717. @6@590:
  1718.    ;    
  1719.    ;                        }
  1720.    ;                    }
  1721.    ;                    if (pProc->pidParent != ptParent->pid)
  1722.    ;    
  1723.     ?debug    L 444
  1724.     les    bx,dword ptr [bp-16]
  1725.     mov    ax,word ptr es:[bx+2]
  1726.     les    bx,dword ptr [bp-10]
  1727.     cmp    ax,word ptr es:[bx+2]
  1728.     je    short @6@674
  1729.    ;    
  1730.    ;                    {
  1731.    ;                        pt->nError = EACCES;
  1732.    ;    
  1733.     ?debug    L 446
  1734.     les    bx,dword ptr [bp-6]
  1735.     mov    word ptr es:[bx+62],5
  1736.     jmp    short @6@730
  1737.     jmp    short @6@730
  1738. @6@674:
  1739.    ;    
  1740.    ;                        return -1;
  1741.    ;                    }
  1742.    ;                    nLastZombies = ptParent->nZombies;
  1743.    ;    
  1744.     ?debug    L 449
  1745.     les    bx,dword ptr [bp-10]
  1746.     mov    ax,word ptr es:[bx+10]
  1747.     mov    word ptr [bp-18],ax
  1748.    ;    
  1749.    ;                    if (iEntry == -1)
  1750.    ;    
  1751.     ?debug    L 450
  1752.     cmp    di,-1
  1753.     jne    short @6@758
  1754.    ;    
  1755.    ;                    {
  1756.    ;                        pt->nError = EFAULT;
  1757.    ;    
  1758.     ?debug    L 452
  1759.     les    bx,dword ptr [bp-6]
  1760.     mov    word ptr es:[bx+62],14
  1761. @6@730:
  1762.    ;    
  1763.    ;                        return -1;
  1764.    ;    
  1765.     ?debug    L 453
  1766.     mov    ax,-1
  1767.     jmp    @6@1486
  1768. @6@758:
  1769.    ;    
  1770.    ;                    }
  1771.    ;                    if (!bZombie && (nFlags & WNOHANG))
  1772.    ;    
  1773.     ?debug    L 455
  1774.     cmp    word ptr [bp-12],0
  1775.     jne    short @6@842
  1776.     test    byte ptr [bp+12],1
  1777.     je    short @6@842
  1778.    ;    
  1779.    ;                        return 0;
  1780.    ;    
  1781.     ?debug    L 456
  1782.     jmp    @6@1402
  1783. @6@842:
  1784.    ;    
  1785.    ;                    if (bZombie)
  1786.    ;    
  1787.     ?debug    L 457
  1788.     cmp    word ptr [bp-12],0
  1789.     je    short @6@954
  1790.    ;    
  1791.    ;                    {
  1792.    ;                        wstatus->w_status = 0;
  1793.    ;    
  1794.     ?debug    L 459
  1795.     les    bx,dword ptr [bp+8]
  1796.     mov    word ptr es:[bx+2],0
  1797.     mov    word ptr es:[bx],0
  1798.    ;    
  1799.    ;                        wstatus->w_retcode = _zombies[iEntry].nRetCode;
  1800.    ;    
  1801.     ?debug    L 460
  1802.     mov    bx,di
  1803.     imul    bx,bx,12
  1804.     mov    al,byte ptr DGROUP:__zombies[bx+10]
  1805.     and    ax,255
  1806.     les    bx,dword ptr [bp+8]
  1807.     and    byte ptr es:[bx+2],0
  1808.     or    byte ptr es:[bx+2],al
  1809.    ;    
  1810.    ;                        nZombies--;
  1811.    ;    
  1812.     ?debug    L 461
  1813.     dec    word ptr DGROUP:nZombies
  1814.    ;    
  1815.    ;                        if (iEntry < nZombies)
  1816.    ;    
  1817.     ?debug    L 462
  1818.     cmp    di,word ptr DGROUP:nZombies
  1819.     jge    short @6@926
  1820.    ;    
  1821.    ;                            _zombies[i] = _zombies[nZombies];
  1822.    ;    
  1823.     ?debug    L 463
  1824.     mov    ax,si
  1825.     imul    ax,ax,12
  1826.     add    ax,offset DGROUP:__zombies
  1827.     push    ds
  1828.     push    ax
  1829.     mov    ax,word ptr DGROUP:nZombies
  1830.     imul    ax,ax,12
  1831.     add    ax,offset DGROUP:__zombies
  1832.     push    ds
  1833.     push    ax
  1834.     mov    cx,12
  1835.     call    far ptr F_SCOPY@
  1836. @6@926:
  1837.    ;    
  1838.    ;                        ptParent->nZombies--;
  1839.    ;    
  1840.     ?debug    L 464
  1841.     les    bx,dword ptr [bp-10]
  1842.     dec    word ptr es:[bx+10]
  1843.    ;    
  1844.    ;                        ptParent->nChildren--;
  1845.    ;    
  1846.     ?debug    L 465
  1847.     les    bx,dword ptr [bp-10]
  1848.     dec    word ptr es:[bx+8]
  1849.     jmp    @6@1262
  1850. @6@954:
  1851.    ;    
  1852.    ;                        return pid;
  1853.    ;                    }
  1854.    ;                }
  1855.    ;    
  1856.     ?debug    L 468
  1857.     jmp    short @6@1066
  1858. @6@982:
  1859.    ;    
  1860.    ;                else if (!ptParent->nZombies && (nFlags & WNOHANG))
  1861.    ;    
  1862.     ?debug    L 469
  1863.     les    bx,dword ptr [bp-10]
  1864.     cmp    word ptr es:[bx+10],0
  1865.     jne    short @6@1066
  1866.     test    byte ptr [bp+12],1
  1867.     je    short @6@1066
  1868.     jmp    @6@1402
  1869. @6@1066:
  1870.    ;    
  1871.    ;                {
  1872.    ;                    return 0;
  1873.    ;                }
  1874.    ;            }
  1875.    ;    
  1876.     ?debug    L 473
  1877.     jmp    @6@1430
  1878. @6@1094:
  1879.    ;    
  1880.    ;            else if (ptParent->nZombies)
  1881.    ;    
  1882.     ?debug    L 474
  1883.     les    bx,dword ptr [bp-10]
  1884.     cmp    word ptr es:[bx+10],0
  1885.     jne    @@5
  1886.     jmp    @6@1374
  1887. @@5:
  1888.    ;    
  1889.    ;            {
  1890.    ;                for (i = 0; i < nZombies; i++)
  1891.    ;    
  1892.     ?debug    L 476
  1893.     xor    si,si
  1894.     jmp    @6@1318
  1895. @6@1150:
  1896.    ;    
  1897.    ;                {
  1898.    ;                    if (_zombies[i].pidParent == ptParent->pid)
  1899.    ;    
  1900.     ?debug    L 478
  1901.     mov    bx,si
  1902.     imul    bx,bx,12
  1903.     mov    ax,word ptr DGROUP:__zombies[bx+2]
  1904.     les    bx,dword ptr [bp-10]
  1905.     cmp    ax,word ptr es:[bx+2]
  1906.     jne    short @6@1290
  1907.    ;    
  1908.    ;                    {
  1909.    ;                        pid = _zombies[i].pid;
  1910.    ;    
  1911.     ?debug    L 480
  1912.     mov    bx,si
  1913.     imul    bx,bx,12
  1914.     mov    ax,word ptr DGROUP:__zombies[bx]
  1915.     mov    word ptr [bp+6],ax
  1916.    ;    
  1917.    ;                        wstatus->w_status = 0;
  1918.    ;    
  1919.     ?debug    L 481
  1920.     les    bx,dword ptr [bp+8]
  1921.     mov    word ptr es:[bx+2],0
  1922.     mov    word ptr es:[bx],0
  1923.    ;    
  1924.    ;                        wstatus->w_retcode = _zombies[i].nRetCode;
  1925.    ;    
  1926.     ?debug    L 482
  1927.     mov    bx,si
  1928.     imul    bx,bx,12
  1929.     mov    al,byte ptr DGROUP:__zombies[bx+10]
  1930.     and    ax,255
  1931.     les    bx,dword ptr [bp+8]
  1932.     and    byte ptr es:[bx+2],0
  1933.     or    byte ptr es:[bx+2],al
  1934.    ;    
  1935.    ;                        if (i < nZombies - 1)
  1936.    ;    
  1937.     ?debug    L 483
  1938.     mov    ax,word ptr DGROUP:nZombies
  1939.     dec    ax
  1940.     cmp    ax,si
  1941.     jle    short @6@1234
  1942.    ;    
  1943.    ;                            _zombies[i] = _zombies[nZombies - 1];
  1944.    ;    
  1945.     ?debug    L 484
  1946.     mov    ax,si
  1947.     imul    ax,ax,12
  1948.     add    ax,offset DGROUP:__zombies
  1949.     push    ds
  1950.     push    ax
  1951.     mov    ax,word ptr DGROUP:nZombies
  1952.     imul    ax,ax,12
  1953.     add    ax,offset DGROUP:__zombies-12
  1954.     push    ds
  1955.     push    ax
  1956.     mov    cx,12
  1957.     call    far ptr F_SCOPY@
  1958. @6@1234:
  1959.    ;    
  1960.    ;                        nZombies--;
  1961.    ;    
  1962.     ?debug    L 485
  1963.     dec    word ptr DGROUP:nZombies
  1964.    ;    
  1965.    ;                        ptParent->nZombies--;
  1966.    ;    
  1967.     ?debug    L 486
  1968.     les    bx,dword ptr [bp-10]
  1969.     dec    word ptr es:[bx+10]
  1970.    ;    
  1971.    ;                        ptParent->nChildren--;
  1972.    ;    
  1973.     ?debug    L 487
  1974.     les    bx,dword ptr [bp-10]
  1975.     dec    word ptr es:[bx+8]
  1976. @6@1262:
  1977.    ;    
  1978.    ;                        return pid;
  1979.    ;    
  1980.     ?debug    L 488
  1981.     mov    ax,word ptr [bp+6]
  1982.     jmp    short @6@1486
  1983. @6@1290:
  1984.     ?debug    L 476
  1985.     inc    si
  1986. @6@1318:
  1987.     cmp    si,word ptr DGROUP:nZombies
  1988.     jge    @@6
  1989.     jmp    @6@1150
  1990. @@6:
  1991.    ;    
  1992.    ;                    }
  1993.    ;                }
  1994.    ;            }
  1995.    ;    
  1996.     ?debug    L 491
  1997.     jmp    short @6@1430
  1998. @6@1374:
  1999.    ;    
  2000.    ;            else if (nFlags & WNOHANG)
  2001.    ;    
  2002.     ?debug    L 492
  2003.     test    byte ptr [bp+12],1
  2004.     je    short @6@1430
  2005. @6@1402:
  2006.    ;    
  2007.    ;            {
  2008.    ;                return 0;
  2009.    ;    
  2010.     ?debug    L 494
  2011.     xor    ax,ax
  2012.     jmp    short @6@1486
  2013. @6@1430:
  2014.    ;    
  2015.    ;            }
  2016.    ;    
  2017.    ;            /* Wait until the parent has dead children */
  2018.    ;            GetMessages(pt);
  2019.    ;    
  2020.     ?debug    L 498
  2021.     push    word ptr [bp-4]
  2022.     push    word ptr [bp-6]
  2023.     call    far ptr _GetMessages
  2024.     add    sp,4
  2025.     jmp    @6@198
  2026. @6@1486:
  2027.    ;    
  2028.    ;        }
  2029.    ;    }
  2030.    ;    
  2031.     ?debug    L 500
  2032.     pop    di
  2033.     pop    si
  2034.     lea    sp,word ptr [bp-2]
  2035.     pop    ds
  2036.     pop    bp
  2037.     dec    bp
  2038.     ret    
  2039.     ?debug    C E32B0A746B5F70726F636573730C001E22
  2040.     ?debug    C E32A000400162B00
  2041.     ?debug    C E60C6E4C6173745A6F6D626965730402EEFF0000+
  2042.     ?debug    C 057050726F632A02F0FF00000669456E74727904+
  2043.     ?debug    C 0407000007625A6F6D6269650402F4FF00000870+
  2044.     ?debug    C 74506172656E741E02F6FF00000270741E02FAFF+
  2045.     ?debug    C 00000169040406000003706964040A0600000007+
  2046.     ?debug    C 77737461747573240A08000000066E466C616773+
  2047.     ?debug    C 040A0C000000
  2048.     ?debug    E
  2049.     ?debug    E
  2050. _tkern_waitpid    endp
  2051.    ;    
  2052.    ;    tkern_fork(void)
  2053.    ;    
  2054.     ?debug    L 514
  2055.     assume    cs:PROCESS_TEXT,ds:DGROUP
  2056. _tkern_fork    proc    far
  2057.     ?debug    B
  2058.     mov    ax,DGROUP
  2059.     inc    bp
  2060.     push    bp
  2061.     mov    bp,sp
  2062.     push    ds
  2063.     mov    ds,ax
  2064.     sub    sp,4
  2065.     push    si
  2066.     push    di
  2067.     ?debug    B
  2068.    ;    
  2069.    ;    {
  2070.    ;        struct    task *pt;
  2071.    ;        int    i, j;
  2072.    ;    
  2073.    ;        pt = GetTaskInfo();
  2074.    ;    
  2075.     ?debug    L 519
  2076.     push    cs
  2077.     call    near ptr _GetTaskInfo
  2078.     mov    word ptr [bp-4],dx
  2079.     mov    word ptr [bp-6],ax
  2080.    ;    
  2081.    ;        for (i = 0; i < TNTASK; i++)
  2082.    ;    
  2083.     ?debug    L 520
  2084.     xor    si,si
  2085.     jmp    short @7@142
  2086. @7@58:
  2087.    ;    
  2088.    ;        {
  2089.    ;            if (!_tasks[i].hTask)
  2090.    ;    
  2091.     ?debug    L 522
  2092.     mov    bx,si
  2093.     imul    bx,bx,74
  2094.     cmp    word ptr DGROUP:__tasks[bx],0
  2095.     jne    short @7@114
  2096.    ;    
  2097.    ;                break;
  2098.    ;    
  2099.     ?debug    L 523
  2100.     jmp    short @7@170
  2101. @7@114:
  2102.     ?debug    L 520
  2103.     inc    si
  2104. @7@142:
  2105.     cmp    si,20
  2106.     jl    short @7@58
  2107. @7@170:
  2108.    ;    
  2109.    ;        }
  2110.    ;        if (i == TNTASK)
  2111.    ;    
  2112.     ?debug    L 525
  2113.     cmp    si,20
  2114.     jne    short @7@254
  2115.    ;    
  2116.    ;        {
  2117.    ;            pt->nError = ENOMEM;
  2118.    ;    
  2119.     ?debug    L 527
  2120.     les    bx,dword ptr [bp-6]
  2121.     mov    word ptr es:[bx+62],8
  2122.    ;    
  2123.    ;            return -1;
  2124.    ;    
  2125.     ?debug    L 528
  2126.     mov    ax,-1
  2127.     jmp    @7@534
  2128. @7@254:
  2129.    ;    
  2130.    ;        }
  2131.    ;        pt->iFledgeling = i;
  2132.    ;    
  2133.     ?debug    L 530
  2134.     les    bx,dword ptr [bp-6]
  2135.     mov    word ptr es:[bx+4],si
  2136.    ;    
  2137.    ;        _tasks[i].hTask = HTASK_FLEDGELING;
  2138.    ;    
  2139.     ?debug    L 531
  2140.     mov    bx,si
  2141.     imul    bx,bx,74
  2142.     mov    word ptr DGROUP:__tasks[bx],-1
  2143.    ;    
  2144.    ;        _tasks[i].iParent = (pt - _tasks);
  2145.    ;    
  2146.     ?debug    L 532
  2147.     push    0
  2148.     push    74
  2149.     mov    ax,word ptr [bp-6]
  2150.     xor    dx,dx
  2151.     sub    ax,offset DGROUP:__tasks
  2152.     sbb    dx,0
  2153.     push    dx
  2154.     push    ax
  2155.     call    far ptr F_LDIV@
  2156.     mov    bx,si
  2157.     imul    bx,bx,74
  2158.     mov    word ptr DGROUP:__tasks[bx+6],ax
  2159.    ;    
  2160.    ;        memcpy(_tasks[i].files, pt->files, sizeof(_tasks[i].files));
  2161.    ;    
  2162.     ?debug    L 533
  2163.     push    40
  2164.     mov    ax,word ptr [bp-6]
  2165.     add    ax,12
  2166.     push    word ptr [bp-4]
  2167.     push    ax
  2168.     push    ds
  2169.     mov    ax,si
  2170.     imul    ax,ax,74
  2171.     add    ax,offset DGROUP:__tasks+12
  2172.     push    ax
  2173.     call    far ptr _memcpy
  2174.     add    sp,10
  2175.    ;    
  2176.    ;        if (_tasks[i].files[0] == -1 ||
  2177.    ;    
  2178.     ?debug    L 534
  2179.    ;    
  2180.    ;            _tasks[i].files[1] == -1 ||
  2181.    ;            _tasks[i].files[2] == -1)
  2182.    ;    
  2183.     ?debug    L 536
  2184.     mov    bx,si
  2185.     imul    bx,bx,74
  2186.     cmp    word ptr DGROUP:__tasks[bx+12],-1
  2187.     je    short @7@338
  2188.     mov    bx,si
  2189.     imul    bx,bx,74
  2190.     cmp    word ptr DGROUP:__tasks[bx+14],-1
  2191.     je    short @7@338
  2192.     mov    bx,si
  2193.     imul    bx,bx,74
  2194.     cmp    word ptr DGROUP:__tasks[bx+16],-1
  2195.     jne    short @7@366
  2196. @7@338:
  2197.    ;    
  2198.    ;            MessageBox(0, "Files are all mixed up", 0, MB_OK);
  2199.    ;    
  2200.     ?debug    L 537
  2201.     push    0
  2202.     push    ds
  2203.     push    offset DGROUP:s@+232
  2204.     push    0
  2205.     push    0
  2206.     push    0
  2207.     call    far ptr MESSAGEBOX
  2208. @7@366:
  2209.    ;    
  2210.    ;        for (j = 0; j < UFILE_MAX; j++)
  2211.    ;    
  2212.     ?debug    L 538
  2213.     xor    di,di
  2214.     jmp    short @7@478
  2215. @7@394:
  2216.    ;    
  2217.    ;        {
  2218.    ;            if (_tasks[i].files[j] != -1)
  2219.    ;    
  2220.     ?debug    L 540
  2221.     mov    bx,si
  2222.     imul    bx,bx,74
  2223.     mov    ax,di
  2224.     add    ax,ax
  2225.     add    bx,ax
  2226.     cmp    word ptr DGROUP:__tasks[bx+12],-1
  2227.     je    short @7@450
  2228.    ;    
  2229.    ;                _files[_tasks[i].files[j]].tf_cnt++;
  2230.    ;    
  2231.     ?debug    L 541
  2232.     mov    bx,si
  2233.     imul    bx,bx,74
  2234.     mov    ax,di
  2235.     add    ax,ax
  2236.     add    bx,ax
  2237.     mov    bx,word ptr DGROUP:__tasks[bx+12]
  2238.     shl    bx,3
  2239.     inc    word ptr DGROUP:__files[bx+2]
  2240. @7@450:
  2241.     ?debug    L 538
  2242.     inc    di
  2243. @7@478:
  2244.     cmp    di,20
  2245.     jl    short @7@394
  2246.    ;    
  2247.    ;        }
  2248.    ;        return 0; /* When we return, we are in the "child" process */
  2249.    ;    
  2250.     ?debug    L 543
  2251.     xor    ax,ax
  2252.     jmp    short @7@534
  2253. @7@534:
  2254.    ;    
  2255.    ;    }
  2256.    ;    
  2257.     ?debug    L 544
  2258.     pop    di
  2259.     pop    si
  2260.     pop    cx
  2261.     pop    cx
  2262.     pop    ds
  2263.     pop    bp
  2264.     dec    bp
  2265.     ret    
  2266.     ?debug    C E6016A0404070000016904040600000270741E02+
  2267.     ?debug    C FAFF0000
  2268.     ?debug    E
  2269.     ?debug    E
  2270. _tkern_fork    endp
  2271.    ;    
  2272.    ;    tkern_total_zombies(void)
  2273.    ;    
  2274.     ?debug    L 548
  2275.     assume    cs:PROCESS_TEXT,ds:DGROUP
  2276. _tkern_total_zombies    proc    far
  2277.     ?debug    B
  2278.     mov    ax,DGROUP
  2279.     inc    bp
  2280.     push    bp
  2281.     mov    bp,sp
  2282.     push    ds
  2283.     mov    ds,ax
  2284.     ?debug    B
  2285.    ;    
  2286.    ;    {
  2287.    ;        return nZombies;
  2288.    ;    
  2289.     ?debug    L 550
  2290.     mov    ax,word ptr DGROUP:nZombies
  2291.     jmp    short @8@58
  2292. @8@58:
  2293.    ;    
  2294.    ;    }
  2295.    ;    
  2296.     ?debug    L 551
  2297.     pop    ds
  2298.     pop    bp
  2299.     dec    bp
  2300.     ret    
  2301.     ?debug    E
  2302.     ?debug    E
  2303. _tkern_total_zombies    endp
  2304.    ;    
  2305.    ;    tkern_list_zombies(    struct tk_process *pList,
  2306.    ;    
  2307.     ?debug    L 554
  2308.     assume    cs:PROCESS_TEXT,ds:DGROUP
  2309. _tkern_list_zombies    proc    far
  2310.     ?debug    B
  2311.     mov    ax,DGROUP
  2312.     inc    bp
  2313.     push    bp
  2314.     mov    bp,sp
  2315.     push    ds
  2316.     mov    ds,ax
  2317.     push    si
  2318.     ?debug    C E6086E456E7472696573040A0A00000005704C69+
  2319.     ?debug    C 73742A0A06000000
  2320.     mov    si,word ptr [bp+10]
  2321.     ?debug    B
  2322.    ;    
  2323.    ;                int    nEntries)
  2324.    ;    {
  2325.    ;    
  2326.    ;        if (nZombies < nEntries)
  2327.    ;    
  2328.     ?debug    L 558
  2329.     cmp    word ptr DGROUP:nZombies,si
  2330.     jge    short @9@86
  2331.    ;    
  2332.    ;            nEntries = nZombies;
  2333.    ;    
  2334.     ?debug    L 559
  2335.     mov    si,word ptr DGROUP:nZombies
  2336. @9@86:
  2337.    ;    
  2338.    ;        memcpy(pList, _zombies, sizeof(*pList) * nEntries);
  2339.    ;    
  2340.     ?debug    L 560
  2341.     mov    ax,si
  2342.     imul    ax,ax,12
  2343.     push    ax
  2344.     push    ds
  2345.     push    offset DGROUP:__zombies
  2346.     push    word ptr [bp+8]
  2347.     push    word ptr [bp+6]
  2348.     call    far ptr _memcpy
  2349.     add    sp,10
  2350.    ;    
  2351.    ;        return nEntries;
  2352.    ;    
  2353.     ?debug    L 561
  2354.     mov    ax,si
  2355.     jmp    short @9@142
  2356. @9@142:
  2357.    ;    
  2358.    ;    }
  2359.    ;    
  2360.     ?debug    L 562
  2361.     pop    si
  2362.     pop    ds
  2363.     pop    bp
  2364.     dec    bp
  2365.     ret    
  2366.     ?debug    C E605704C6973742A0A06000000086E456E747269+
  2367.     ?debug    C 6573040C060000
  2368.     ?debug    E
  2369.     ?debug    E
  2370. _tkern_list_zombies    endp
  2371.    ;    
  2372.    ;    tkern_get_process(    HTASK    hTask,
  2373.    ;    
  2374.     ?debug    L 568
  2375.     assume    cs:PROCESS_TEXT,ds:DGROUP
  2376. _tkern_get_process    proc    far
  2377.     ?debug    B
  2378.     mov    ax,DGROUP
  2379.     inc    bp
  2380.     push    bp
  2381.     mov    bp,sp
  2382.     push    ds
  2383.     mov    ds,ax
  2384.     ?debug    C E607746B5F70726F632A0A080000000568546173+
  2385.     ?debug    C 6B180A06000000
  2386.     ?debug    B
  2387.    ;    
  2388.    ;                struct    tk_process *tk_proc)
  2389.    ;    {
  2390.    ;        int    i;
  2391.    ;    
  2392.    ;        for (i = 0; i < nProcesses; i++)
  2393.    ;    
  2394.     ?debug    L 573
  2395.     xor    dx,dx
  2396.     jmp    short @10@170
  2397. @10@58:
  2398.    ;    
  2399.    ;        {
  2400.    ;            if (_process[i].hTask == hTask)
  2401.    ;    
  2402.     ?debug    L 575
  2403.     mov    bx,dx
  2404.     imul    bx,bx,12
  2405.     mov    ax,word ptr DGROUP:__process[bx+4]
  2406.     cmp    ax,word ptr [bp+6]
  2407.     jne    short @10@142
  2408.    ;    
  2409.    ;            {
  2410.    ;                *tk_proc = _process[i];
  2411.    ;    
  2412.     ?debug    L 577
  2413.     push    word ptr [bp+10]
  2414.     push    word ptr [bp+8]
  2415.     mov    ax,dx
  2416.     imul    ax,ax,12
  2417.     add    ax,offset DGROUP:__process
  2418.     push    ds
  2419.     push    ax
  2420.     mov    cx,12
  2421.     call    far ptr F_SCOPY@
  2422.    ;    
  2423.    ;                return _process[i].pid;
  2424.    ;    
  2425.     ?debug    L 578
  2426.     mov    bx,dx
  2427.     imul    bx,bx,12
  2428.     mov    ax,word ptr DGROUP:__process[bx]
  2429.     jmp    short @10@226
  2430. @10@142:
  2431.     ?debug    L 573
  2432.     inc    dx
  2433. @10@170:
  2434.     cmp    dx,word ptr DGROUP:nProcesses
  2435.     jl    short @10@58
  2436.    ;    
  2437.    ;            }
  2438.    ;        }
  2439.    ;        return 0;
  2440.    ;    
  2441.     ?debug    L 581
  2442.     xor    ax,ax
  2443.     jmp    short @10@226
  2444. @10@226:
  2445.    ;    
  2446.    ;    }
  2447.    ;    
  2448.     ?debug    L 582
  2449.     pop    ds
  2450.     pop    bp
  2451.     dec    bp
  2452.     ret    
  2453.     ?debug    C E60169040402000005685461736B180A06000000+
  2454.     ?debug    C 07746B5F70726F632A0A08000000
  2455.     ?debug    E
  2456.     ?debug    E
  2457. _tkern_get_process    endp
  2458.    ;    
  2459.    ;    tkern_register_program(    int    *argc,
  2460.    ;    
  2461.     ?debug    L 589
  2462.     assume    cs:PROCESS_TEXT,ds:DGROUP
  2463. _tkern_register_program    proc    far
  2464.     ?debug    B
  2465.     mov    ax,DGROUP
  2466.     inc    bp
  2467.     push    bp
  2468.     mov    bp,sp
  2469.     push    ds
  2470.     mov    ds,ax
  2471.     sub    sp,114
  2472.     push    si
  2473.     ?debug    C E32C000400160400
  2474.     ?debug    C E32D000400162100
  2475.     ?debug    C E604656E76702D0A0E00000004617267762D0A0A+
  2476.     ?debug    C 00000004617267632C0A06000000
  2477.     ?debug    B
  2478.    ;    
  2479.    ;                char    ***argv,
  2480.    ;                char    ***envp)
  2481.    ;    {
  2482.    ;        int    i;
  2483.    ;        struct task *pt, *pt_;
  2484.    ;        TASKENTRY te;
  2485.    ;        int    nTKExecIn_, nTKExecOut_;
  2486.    ;        HTASK    htaskParent_;
  2487.    ;    
  2488.    ;        TaskFindHandle(&te, GetCurrentTask());
  2489.    ;    
  2490.     ?debug    L 599
  2491.     push    ss
  2492.     lea    ax,word ptr [bp-56]
  2493.     push    ax
  2494.     call    far ptr GETCURRENTTASK
  2495.     push    ax
  2496.     call    far ptr TASKFINDHANDLE
  2497.    ;    
  2498.    ;        htaskParent_ = te.hTaskParent;
  2499.    ;    
  2500.     ?debug    L 600
  2501.     mov    si,word ptr [bp-50]
  2502.    ;    
  2503.    ;        if (htaskParent)
  2504.    ;    
  2505.     ?debug    L 601
  2506.     cmp    word ptr DGROUP:htaskParent,0
  2507.     jne    @@7
  2508.     jmp    @11@786
  2509. @@7:
  2510.    ;    
  2511.    ;        {
  2512.    ;            nTKExecIn_ = nTKExecIn;
  2513.    ;    
  2514.     ?debug    L 603
  2515.     mov    ax,word ptr DGROUP:_nTKExecIn
  2516.     mov    word ptr [bp-14],ax
  2517.    ;    
  2518.    ;            nTKExecOut_ = nTKExecOut;
  2519.    ;    
  2520.     ?debug    L 604
  2521.     mov    ax,word ptr DGROUP:_nTKExecOut
  2522.     mov    word ptr [bp-16],ax
  2523.    ;    
  2524.    ;            /* Because of the way tkern_exec() is written,
  2525.    ;             * the only way this can be true is if this
  2526.    ;             * is the task spawned from the tkern_exec()
  2527.    ;             */
  2528.    ;            pt = ptNext;
  2529.    ;    
  2530.     ?debug    L 609
  2531.     mov    dx,word ptr DGROUP:ptNext+2
  2532.     mov    ax,word ptr DGROUP:ptNext
  2533.     mov    word ptr [bp-6],dx
  2534.     mov    word ptr [bp-8],ax
  2535.    ;    
  2536.    ;            pt->hTask = GetCurrentTask();
  2537.    ;    
  2538.     ?debug    L 610
  2539.     call    far ptr GETCURRENTTASK
  2540.     les    bx,dword ptr [bp-8]
  2541.     mov    word ptr es:[bx],ax
  2542.    ;    
  2543.    ;            for (i = 0; pt->argv[i]; i++);
  2544.    ;    
  2545.     ?debug    L 611
  2546.     mov    word ptr [bp-4],0
  2547.     jmp    short @11@114
  2548. @11@86:
  2549.     inc    word ptr [bp-4]
  2550. @11@114:
  2551.     les    bx,dword ptr [bp-8]
  2552.     les    bx,dword ptr es:[bx+52]
  2553.     mov    ax,word ptr [bp-4]
  2554.     shl    ax,2
  2555.     add    bx,ax
  2556.     mov    ax,word ptr es:[bx]
  2557.     or    ax,word ptr es:[bx+2]
  2558.     jne    short @11@86
  2559.    ;    
  2560.    ;            *argc = i;
  2561.    ;    
  2562.     ?debug    L 612
  2563.     les    bx,dword ptr [bp+6]
  2564.     mov    ax,word ptr [bp-4]
  2565.     mov    word ptr es:[bx],ax
  2566.    ;    
  2567.    ;            *argv = pt->argv;
  2568.    ;    
  2569.     ?debug    L 613
  2570.     les    bx,dword ptr [bp-8]
  2571.     mov    dx,word ptr es:[bx+54]
  2572.     mov    ax,word ptr es:[bx+52]
  2573.     les    bx,dword ptr [bp+10]
  2574.     mov    word ptr es:[bx+2],dx
  2575.     mov    word ptr es:[bx],ax
  2576.    ;    
  2577.    ;            *envp = pt->envp;
  2578.    ;    
  2579.     ?debug    L 614
  2580.     les    bx,dword ptr [bp-8]
  2581.     mov    dx,word ptr es:[bx+58]
  2582.     mov    ax,word ptr es:[bx+56]
  2583.     les    bx,dword ptr [bp+14]
  2584.     mov    word ptr es:[bx+2],dx
  2585.     mov    word ptr es:[bx],ax
  2586.    ;    
  2587.    ;            pt->pid = pidCurrent;
  2588.    ;    
  2589.     ?debug    L 615
  2590.     les    bx,dword ptr [bp-8]
  2591.     mov    ax,word ptr DGROUP:pidCurrent
  2592.     mov    word ptr es:[bx+2],ax
  2593.    ;    
  2594.    ;            if (pt->iFledgeling != -1)
  2595.    ;    
  2596.     ?debug    L 616
  2597.     les    bx,dword ptr [bp-8]
  2598.     cmp    word ptr es:[bx+4],-1
  2599.     je    short @11@198
  2600.    ;    
  2601.    ;                MessageBox(0, "iFledgeling is not -1", 0, MB_OK);
  2602.    ;    
  2603.     ?debug    L 617
  2604.     push    0
  2605.     push    ds
  2606.     push    offset DGROUP:s@+255
  2607.     push    0
  2608.     push    0
  2609.     push    0
  2610.     call    far ptr MESSAGEBOX
  2611. @11@198:
  2612.    ;    
  2613.    ;            if (pt->files[0] == -1)
  2614.    ;    
  2615.     ?debug    L 618
  2616.     les    bx,dword ptr [bp-8]
  2617.     cmp    word ptr es:[bx+12],-1
  2618.     jne    short @11@254
  2619.    ;    
  2620.    ;                MessageBox(0, "File 0 is -1", 0, MB_OK);
  2621.    ;    
  2622.     ?debug    L 619
  2623.     push    0
  2624.     push    ds
  2625.     push    offset DGROUP:s@+277
  2626.     push    0
  2627.     push    0
  2628.     push    0
  2629.     call    far ptr MESSAGEBOX
  2630. @11@254:
  2631.    ;    
  2632.    ;            if (!tkern_valid_file(0))
  2633.    ;    
  2634.     ?debug    L 620
  2635.     push    0
  2636.     call    far ptr _tkern_valid_file
  2637.     pop    cx
  2638.     or    ax,ax
  2639.     jne    short @11@310
  2640.    ;    
  2641.    ;            {
  2642.    ;                MessageBox(0, "File 0 is invalid", 0, MB_OK);
  2643.    ;    
  2644.     ?debug    L 622
  2645.     push    0
  2646.     push    ds
  2647.     push    offset DGROUP:s@+290
  2648.     push    0
  2649.     push    0
  2650.     push    0
  2651.     call    far ptr MESSAGEBOX
  2652. @11@310:
  2653.    ;    
  2654.    ;            }
  2655.    ;            if (!tkern_valid_file(1))
  2656.    ;    
  2657.     ?debug    L 624
  2658.     push    1
  2659.     call    far ptr _tkern_valid_file
  2660.     pop    cx
  2661.     or    ax,ax
  2662.     jne    short @11@366
  2663.    ;    
  2664.    ;            {
  2665.    ;                MessageBox(0, "File 1 is invalid", 0, MB_OK);
  2666.    ;    
  2667.     ?debug    L 626
  2668.     push    0
  2669.     push    ds
  2670.     push    offset DGROUP:s@+308
  2671.     push    0
  2672.     push    0
  2673.     push    0
  2674.     call    far ptr MESSAGEBOX
  2675. @11@366:
  2676.    ;    
  2677.    ;            }
  2678.    ;            if (!tkern_valid_file(2))
  2679.    ;    
  2680.     ?debug    L 628
  2681.     push    2
  2682.     call    far ptr _tkern_valid_file
  2683.     pop    cx
  2684.     or    ax,ax
  2685.     jne    short @11@422
  2686.    ;    
  2687.    ;            {
  2688.    ;                MessageBox(0, "File 2 is invalid", 0, MB_OK);
  2689.    ;    
  2690.     ?debug    L 630
  2691.     push    0
  2692.     push    ds
  2693.     push    offset DGROUP:s@+326
  2694.     push    0
  2695.     push    0
  2696.     push    0
  2697.     call    far ptr MESSAGEBOX
  2698. @11@422:
  2699.    ;    
  2700.    ;            }
  2701.    ;            if (pt != ptLast)
  2702.    ;    
  2703.     ?debug    L 632
  2704.     mov    dx,word ptr [bp-6]
  2705.     mov    ax,word ptr [bp-8]
  2706.     cmp    dx,word ptr DGROUP:ptLast+2
  2707.     jne    short @11@478
  2708.     cmp    ax,word ptr DGROUP:ptLast
  2709.     je    short @11@506
  2710. @11@478:
  2711.     ?debug    B
  2712.    ;    
  2713.    ;            {
  2714.    ;                char achBuffer[60];
  2715.    ;                sprintf(achBuffer, "ptNext: %p, ptLast: %p", pt, ptLast);
  2716.    ;    
  2717.     ?debug    L 635
  2718.     push    word ptr DGROUP:ptLast+2
  2719.     push    word ptr DGROUP:ptLast
  2720.     push    word ptr [bp-6]
  2721.     push    word ptr [bp-8]
  2722.     push    ds
  2723.     push    offset DGROUP:s@+344
  2724.     push    ss
  2725.     lea    ax,word ptr [bp-116]
  2726.     push    ax
  2727.     call    far ptr _sprintf
  2728.     add    sp,16
  2729.    ;    
  2730.    ;                MessageBox(0, achBuffer, 0, MB_OK);
  2731.    ;    
  2732.     ?debug    L 636
  2733.     push    0
  2734.     push    ss
  2735.     lea    ax,word ptr [bp-116]
  2736.     push    ax
  2737.     push    0
  2738.     push    0
  2739.     push    0
  2740.     call    far ptr MESSAGEBOX
  2741.    ;    
  2742.    ;                sprintf(achBuffer, "In: %d, Out: %d", nTKExecIn_, nTKExecOut_);
  2743.    ;    
  2744.     ?debug    L 637
  2745.     push    word ptr [bp-16]
  2746.     push    word ptr [bp-14]
  2747.     push    ds
  2748.     push    offset DGROUP:s@+367
  2749.     push    ss
  2750.     lea    ax,word ptr [bp-116]
  2751.     push    ax
  2752.     call    far ptr _sprintf
  2753.     add    sp,12
  2754.    ;    
  2755.    ;                MessageBox(0, achBuffer, 0, MB_OK);
  2756.    ;    
  2757.     ?debug    L 638
  2758.     push    0
  2759.     push    ss
  2760.     lea    ax,word ptr [bp-116]
  2761.     push    ax
  2762.     push    0
  2763.     push    0
  2764.     push    0
  2765.     call    far ptr MESSAGEBOX
  2766. @11@506:
  2767.     ?debug    C E32E003C001A02
  2768.     ?debug    C E6096163684275666665722E028CFF0000
  2769.     ?debug    E
  2770.    ;    
  2771.    ;            }
  2772.    ;            if (pt->hTask != GetCurrentTask())
  2773.    ;    
  2774.     ?debug    L 640
  2775.     call    far ptr GETCURRENTTASK
  2776.     les    bx,dword ptr [bp-8]
  2777.     cmp    ax,word ptr es:[bx]
  2778.     je    short @11@562
  2779.    ;    
  2780.    ;                MessageBox(0, "Somebody has touched my hTask!", 0, MB_OK);
  2781.    ;    
  2782.     ?debug    L 641
  2783.     push    0
  2784.     push    ds
  2785.     push    offset DGROUP:s@+383
  2786.     push    0
  2787.     push    0
  2788.     push    0
  2789.     call    far ptr MESSAGEBOX
  2790. @11@562:
  2791.    ;    
  2792.    ;            pt_ = GetTaskInfo();
  2793.    ;    
  2794.     ?debug    L 642
  2795.     push    cs
  2796.     call    near ptr _GetTaskInfo
  2797.     mov    word ptr [bp-10],dx
  2798.     mov    word ptr [bp-12],ax
  2799.    ;    
  2800.    ;            if (pt_ != pt)
  2801.    ;    
  2802.     ?debug    L 643
  2803.     mov    dx,word ptr [bp-10]
  2804.     mov    ax,word ptr [bp-12]
  2805.     cmp    dx,word ptr [bp-6]
  2806.     jne    short @11@618
  2807.     cmp    ax,word ptr [bp-8]
  2808.     je    short @11@646
  2809. @11@618:
  2810.     ?debug    B
  2811.    ;    
  2812.    ;            {
  2813.    ;                char achBuffer[60];
  2814.    ;                MessageBox(0, "pt != GetTaskInfo()", 0, MB_OK);
  2815.    ;    
  2816.     ?debug    L 646
  2817.     push    0
  2818.     push    ds
  2819.     push    offset DGROUP:s@+414
  2820.     push    0
  2821.     push    0
  2822.     push    0
  2823.     call    far ptr MESSAGEBOX
  2824.    ;    
  2825.    ;                sprintf(achBuffer, "Created from %p", pt_->pchCreatedBy);
  2826.    ;    
  2827.     ?debug    L 647
  2828.     les    bx,dword ptr [bp-12]
  2829.     push    word ptr es:[bx+68]
  2830.     push    word ptr es:[bx+66]
  2831.     push    ds
  2832.     push    offset DGROUP:s@+434
  2833.     push    ss
  2834.     lea    ax,word ptr [bp-116]
  2835.     push    ax
  2836.     call    far ptr _sprintf
  2837.     add    sp,12
  2838.    ;    
  2839.    ;                MessageBox(0, achBuffer, 0, MB_OK);
  2840.    ;    
  2841.     ?debug    L 648
  2842.     push    0
  2843.     push    ss
  2844.     lea    ax,word ptr [bp-116]
  2845.     push    ax
  2846.     push    0
  2847.     push    0
  2848.     push    0
  2849.     call    far ptr MESSAGEBOX
  2850.    ;    
  2851.    ;                ((char **) &i)[2] = pt_->pchCreatedBy;
  2852.    ;    
  2853.     ?debug    L 649
  2854.     les    bx,dword ptr [bp-12]
  2855.     mov    dx,word ptr es:[bx+68]
  2856.     mov    ax,word ptr es:[bx+66]
  2857.     mov    word ptr [bp+6],dx
  2858.     mov    word ptr [bp+4],ax
  2859.    ;    
  2860.    ;                *(char *) 0 = 0;
  2861.    ;    
  2862.     ?debug    L 650
  2863.     xor    ax,ax
  2864.     mov    es,ax
  2865.     mov    byte ptr es:[0],0
  2866. @11@646:
  2867.     ?debug    C E32F003C001A02
  2868.     ?debug    C E6096163684275666665722F028CFF0000
  2869.     ?debug    E
  2870.    ;    
  2871.    ;            }
  2872.    ;            if (pt_ < pt)
  2873.    ;    
  2874.     ?debug    L 652
  2875.     mov    ax,word ptr [bp-12]
  2876.     cmp    ax,word ptr [bp-8]
  2877.     jae    short @11@702
  2878.    ;    
  2879.    ;                MessageBox(0, "GetTaskInfo() is smaller", 0, MB_OK);
  2880.    ;    
  2881.     ?debug    L 653
  2882.     push    0
  2883.     push    ds
  2884.     push    offset DGROUP:s@+450
  2885.     push    0
  2886.     push    0
  2887.     push    0
  2888.     call    far ptr MESSAGEBOX
  2889.     jmp    short @11@758
  2890. @11@702:
  2891.    ;    
  2892.    ;            else if (pt_ > pt)
  2893.    ;    
  2894.     ?debug    L 654
  2895.     mov    ax,word ptr [bp-12]
  2896.     cmp    ax,word ptr [bp-8]
  2897.     jbe    short @11@758
  2898.    ;    
  2899.    ;                MessageBox(0, "GetTaskInfo() is larger", 0, MB_OK);
  2900.    ;    
  2901.     ?debug    L 655
  2902.     push    0
  2903.     push    ds
  2904.     push    offset DGROUP:s@+475
  2905.     push    0
  2906.     push    0
  2907.     push    0
  2908.     call    far ptr MESSAGEBOX
  2909. @11@758:
  2910.    ;    
  2911.    ;        }
  2912.    ;    
  2913.     ?debug    L 656
  2914.     jmp    @11@1094
  2915. @11@786:
  2916.     ?debug    B
  2917.    ;    
  2918.    ;        else
  2919.    ;        {
  2920.    ;            char    achParent[60];
  2921.    ;            if (htaskParent)
  2922.    ;    
  2923.     ?debug    L 660
  2924.     cmp    word ptr DGROUP:htaskParent,0
  2925.     je    short @11@842
  2926.    ;    
  2927.    ;                MessageBox(0, "Ummm... htaskParent exists", 0, MB_OK);
  2928.    ;    
  2929.     ?debug    L 661
  2930.     push    0
  2931.     push    ds
  2932.     push    offset DGROUP:s@+499
  2933.     push    0
  2934.     push    0
  2935.     push    0
  2936.     call    far ptr MESSAGEBOX
  2937. @11@842:
  2938.    ;    
  2939.    ;            if (!htaskParent_)
  2940.    ;    
  2941.     ?debug    L 662
  2942.     or    si,si
  2943.     jne    short @11@898
  2944.    ;    
  2945.    ;                MessageBox(0, "My te.htaskParent is 0", 0, MB_OK);
  2946.    ;    
  2947.     ?debug    L 663
  2948.     push    0
  2949.     push    ds
  2950.     push    offset DGROUP:s@+526
  2951.     push    0
  2952.     push    0
  2953.     push    0
  2954.     call    far ptr MESSAGEBOX
  2955. @11@898:
  2956.    ;    
  2957.    ;            sprintf(achParent, "I'm a bastard: htaskParent = %04x", htaskParent_);
  2958.    ;    
  2959.     ?debug    L 664
  2960.     push    si
  2961.     push    ds
  2962.     push    offset DGROUP:s@+549
  2963.     push    ss
  2964.     lea    ax,word ptr [bp-116]
  2965.     push    ax
  2966.     call    far ptr _sprintf
  2967.     add    sp,10
  2968.    ;    
  2969.    ;            MessageBox(0, achParent, 0, MB_OK);
  2970.    ;    
  2971.     ?debug    L 665
  2972.     push    0
  2973.     push    ss
  2974.     lea    ax,word ptr [bp-116]
  2975.     push    ax
  2976.     push    0
  2977.     push    0
  2978.     push    0
  2979.     call    far ptr MESSAGEBOX
  2980.    ;    
  2981.    ;            pt = GetTaskInfo();
  2982.    ;    
  2983.     ?debug    L 666
  2984.     push    cs
  2985.     call    near ptr _GetTaskInfo
  2986.     mov    word ptr [bp-6],dx
  2987.     mov    word ptr [bp-8],ax
  2988.    ;    
  2989.    ;            if (pt->argv)
  2990.    ;    
  2991.     ?debug    L 667
  2992.     les    bx,dword ptr [bp-8]
  2993.     mov    ax,word ptr es:[bx+52]
  2994.     or    ax,word ptr es:[bx+54]
  2995.     je    short @11@1038
  2996.    ;    
  2997.    ;            {
  2998.    ;                for (i = 0; *pt->argv; i++);
  2999.    ;    
  3000.     ?debug    L 669
  3001.     mov    word ptr [bp-4],0
  3002.     jmp    short @11@982
  3003. @11@954:
  3004.     inc    word ptr [bp-4]
  3005. @11@982:
  3006.     les    bx,dword ptr [bp-8]
  3007.     les    bx,dword ptr es:[bx+52]
  3008.     mov    ax,word ptr es:[bx]
  3009.     or    ax,word ptr es:[bx+2]
  3010.     jne    short @11@954
  3011.    ;    
  3012.    ;                *argc = i;
  3013.    ;    
  3014.     ?debug    L 670
  3015.     les    bx,dword ptr [bp+6]
  3016.     mov    ax,word ptr [bp-4]
  3017.     mov    word ptr es:[bx],ax
  3018.    ;    
  3019.    ;                *argv = pt->argv;
  3020.    ;    
  3021.     ?debug    L 671
  3022.     les    bx,dword ptr [bp-8]
  3023.     mov    dx,word ptr es:[bx+54]
  3024.     mov    ax,word ptr es:[bx+52]
  3025.     les    bx,dword ptr [bp+10]
  3026.     mov    word ptr es:[bx+2],dx
  3027.     mov    word ptr es:[bx],ax
  3028.    ;    
  3029.    ;                *envp = pt->envp;
  3030.    ;    
  3031.     ?debug    L 672
  3032.     les    bx,dword ptr [bp-8]
  3033.     mov    dx,word ptr es:[bx+58]
  3034.     mov    ax,word ptr es:[bx+56]
  3035.     les    bx,dword ptr [bp+14]
  3036.     mov    word ptr es:[bx+2],dx
  3037.     mov    word ptr es:[bx],ax
  3038.    ;    
  3039.    ;            }
  3040.    ;    
  3041.     ?debug    L 673
  3042.     jmp    short @11@1066
  3043. @11@1038:
  3044.    ;    
  3045.    ;            else
  3046.    ;            {
  3047.    ;                *argc = 0;
  3048.    ;    
  3049.     ?debug    L 676
  3050.     les    bx,dword ptr [bp+6]
  3051.     mov    word ptr es:[bx],0
  3052.    ;    
  3053.    ;                *argv = 0;
  3054.    ;    
  3055.     ?debug    L 677
  3056.     les    bx,dword ptr [bp+10]
  3057.     mov    word ptr es:[bx+2],0
  3058.     mov    word ptr es:[bx],0
  3059.    ;    
  3060.    ;                *envp = 0;
  3061.    ;    
  3062.     ?debug    L 678
  3063.     les    bx,dword ptr [bp+14]
  3064.     mov    word ptr es:[bx+2],0
  3065.     mov    word ptr es:[bx],0
  3066. @11@1066:
  3067.    ;    
  3068.    ;            }
  3069.    ;            pt->pid = pidCurrent;
  3070.    ;    
  3071.     ?debug    L 680
  3072.     les    bx,dword ptr [bp-8]
  3073.     mov    ax,word ptr DGROUP:pidCurrent
  3074.     mov    word ptr es:[bx+2],ax
  3075. @11@1094:
  3076.     ?debug    C E330003C001A02
  3077.     ?debug    C E609616368506172656E7430028CFF0000
  3078.     ?debug    E
  3079.    ;    
  3080.    ;        }
  3081.    ;    
  3082.    ;        /* We need to flush all messages in the first task because if
  3083.    ;         * that task exits without having yielded, TKFMANGR will miss
  3084.    ;         * the exit notification.
  3085.    ;         */
  3086.    ;        if (!nTasks)
  3087.    ;    
  3088.     ?debug    L 687
  3089.     cmp    word ptr DGROUP:_nTasks,0
  3090.     jne    short @11@1150
  3091.    ;    
  3092.    ;            FlushMessages();
  3093.    ;    
  3094.     ?debug    L 688
  3095.     call    far ptr _FlushMessages
  3096. @11@1150:
  3097.    ;    
  3098.    ;        nTasks++;
  3099.    ;    
  3100.     ?debug    L 689
  3101.     inc    word ptr DGROUP:_nTasks
  3102.     jmp    short @11@1206
  3103. @11@1178:
  3104.    ;    
  3105.    ;        while (!hwndManager)
  3106.    ;            GetMessages(pt);
  3107.    ;    
  3108.     ?debug    L 691
  3109.     push    word ptr [bp-6]
  3110.     push    word ptr [bp-8]
  3111.     call    far ptr _GetMessages
  3112.     add    sp,4
  3113. @11@1206:
  3114.     ?debug    L 690
  3115.     cmp    word ptr DGROUP:_hwndManager,0
  3116.     je    short @11@1178
  3117.    ;    
  3118.    ;    }
  3119.    ;    
  3120.     ?debug    L 692
  3121.     pop    si
  3122.     lea    sp,word ptr [bp-2]
  3123.     pop    ds
  3124.     pop    bp
  3125.     dec    bp
  3126.     ret    
  3127.     ?debug    C E3310C7461675441534B454E54525928001E29
  3128.     ?debug    C E3330B48494E5354414E43455F5F02001E39
  3129.     ?debug    C E332000200153304
  3130.     ?debug    C E334000200150104
  3131.     ?debug    C E335000A001A02
  3132.     ?debug    C E60C687461736B506172656E745F18040600000B+
  3133.     ?debug    C 6E544B457865634F75745F0402F0FF00000A6E54+
  3134.     ?debug    C 4B45786563496E5F0402F2FF00000274653102C8+
  3135.     ?debug    C FF00000370745F1E02F4FF00000270741E02F8FF+
  3136.     ?debug    C 000001690402FCFF000004617267632C0A060000+
  3137.     ?debug    C 0004617267762D0A0A00000004656E76702D0A0E+
  3138.     ?debug    C 000000
  3139.     ?debug    E
  3140.     ?debug    E
  3141. _tkern_register_program    endp
  3142.    ;    
  3143.    ;    task_is_dead(    int    iTask)
  3144.    ;    
  3145.     ?debug    L 695
  3146.     assume    cs:PROCESS_TEXT,ds:DGROUP
  3147. task_is_dead    proc    far
  3148.     ?debug    B
  3149.     mov    ax,DGROUP
  3150.     inc    bp
  3151.     push    bp
  3152.     mov    bp,sp
  3153.     push    ds
  3154.     mov    ds,ax
  3155.     push    si
  3156.     push    di
  3157.     ?debug    C E605695461736B040A06000000
  3158.     mov    si,word ptr [bp+6]
  3159.     ?debug    B
  3160.    ;    
  3161.    ;    {
  3162.    ;        int    iFile;
  3163.    ;    
  3164.    ;        MessageBox(0, "Reaping task", 0, MB_OK);
  3165.    ;    
  3166.     ?debug    L 699
  3167.     push    0
  3168.     push    ds
  3169.     push    offset DGROUP:s@+583
  3170.     push    0
  3171.     push    0
  3172.     push    0
  3173.     call    far ptr MESSAGEBOX
  3174.    ;    
  3175.    ;        if (_tasks[iTask].iFledgeling != -1)
  3176.    ;    
  3177.     ?debug    L 700
  3178.     mov    bx,si
  3179.     imul    bx,bx,74
  3180.     cmp    word ptr DGROUP:__tasks[bx+4],-1
  3181.     je    short @12@86
  3182.    ;    
  3183.    ;            task_is_dead(_tasks[iTask].iFledgeling);
  3184.    ;    
  3185.     ?debug    L 701
  3186.     mov    bx,si
  3187.     imul    bx,bx,74
  3188.     push    word ptr DGROUP:__tasks[bx+4]
  3189.     push    cs
  3190.     call    near ptr task_is_dead
  3191.     pop    cx
  3192. @12@86:
  3193.    ;    
  3194.    ;        for (iFile = 0; iFile < UFILE_MAX; iFile++)
  3195.    ;    
  3196.     ?debug    L 702
  3197.     xor    di,di
  3198.     jmp    short @12@198
  3199. @12@114:
  3200.    ;    
  3201.    ;            if (_tasks[iTask].files[iFile] != -1)
  3202.    ;    
  3203.     ?debug    L 703
  3204.     mov    bx,si
  3205.     imul    bx,bx,74
  3206.     mov    ax,di
  3207.     add    ax,ax
  3208.     add    bx,ax
  3209.     cmp    word ptr DGROUP:__tasks[bx+12],-1
  3210.     je    short @12@170
  3211.    ;    
  3212.    ;                internal_close(iFile, iTask);
  3213.    ;    
  3214.     ?debug    L 704
  3215.     push    si
  3216.     push    di
  3217.     call    far ptr _internal_close
  3218.     add    sp,4
  3219. @12@170:
  3220.     ?debug    L 702
  3221.     inc    di
  3222. @12@198:
  3223.     cmp    di,20
  3224.     jl    short @12@114
  3225.    ;    
  3226.    ;        if (_tasks[iTask].argv)
  3227.    ;    
  3228.     ?debug    L 705
  3229.     mov    bx,si
  3230.     imul    bx,bx,74
  3231.     mov    ax,word ptr DGROUP:__tasks[bx+52]
  3232.     or    ax,word ptr DGROUP:__tasks[bx+54]
  3233.     je    short @12@282
  3234.    ;    
  3235.    ;        {
  3236.    ;            free(_tasks[iTask].argv);
  3237.    ;    
  3238.     ?debug    L 707
  3239.     mov    bx,si
  3240.     imul    bx,bx,74
  3241.     push    word ptr DGROUP:__tasks[bx+54]
  3242.     push    word ptr DGROUP:__tasks[bx+52]
  3243.     call    far ptr _free
  3244.     add    sp,4
  3245.    ;    
  3246.    ;            _tasks[iTask].argv = 0;
  3247.    ;    
  3248.     ?debug    L 708
  3249.     mov    bx,si
  3250.     imul    bx,bx,74
  3251.     mov    word ptr DGROUP:__tasks[bx+54],0
  3252.     mov    word ptr DGROUP:__tasks[bx+52],0
  3253. @12@282:
  3254.    ;    
  3255.    ;        }
  3256.    ;        if (_tasks[iTask].envp)
  3257.    ;    
  3258.     ?debug    L 710
  3259.     mov    bx,si
  3260.     imul    bx,bx,74
  3261.     mov    ax,word ptr DGROUP:__tasks[bx+56]
  3262.     or    ax,word ptr DGROUP:__tasks[bx+58]
  3263.     je    short @12@338
  3264.    ;    
  3265.    ;        {
  3266.    ;            free(_tasks[iTask].envp);
  3267.    ;    
  3268.     ?debug    L 712
  3269.     mov    bx,si
  3270.     imul    bx,bx,74
  3271.     push    word ptr DGROUP:__tasks[bx+58]
  3272.     push    word ptr DGROUP:__tasks[bx+56]
  3273.     call    far ptr _free
  3274.     add    sp,4
  3275.    ;    
  3276.    ;            _tasks[iTask].envp = 0;
  3277.    ;    
  3278.     ?debug    L 713
  3279.     mov    bx,si
  3280.     imul    bx,bx,74
  3281.     mov    word ptr DGROUP:__tasks[bx+58],0
  3282.     mov    word ptr DGROUP:__tasks[bx+56],0
  3283. @12@338:
  3284.    ;    
  3285.    ;        }
  3286.    ;        _tasks[iTask].hTask = 0;
  3287.    ;    
  3288.     ?debug    L 715
  3289.     mov    bx,si
  3290.     imul    bx,bx,74
  3291.     mov    word ptr DGROUP:__tasks[bx],0
  3292.    ;    
  3293.    ;        _tasks[iTask].intrproc = 0;
  3294.    ;    
  3295.     ?debug    L 716
  3296.     mov    bx,si
  3297.     imul    bx,bx,74
  3298.     mov    word ptr DGROUP:__tasks[bx+72],0
  3299.     mov    word ptr DGROUP:__tasks[bx+70],0
  3300.    ;    
  3301.    ;        _tasks[iTask].nSignal = 0;
  3302.    ;    
  3303.     ?debug    L 717
  3304.     mov    bx,si
  3305.     imul    bx,bx,74
  3306.     mov    word ptr DGROUP:__tasks[bx+64],0
  3307.    ;    
  3308.    ;        _tasks[iTask].iFledgeling = -1;
  3309.    ;    
  3310.     ?debug    L 718
  3311.     mov    bx,si
  3312.     imul    bx,bx,74
  3313.     mov    word ptr DGROUP:__tasks[bx+4],-1
  3314.    ;    
  3315.    ;    }
  3316.    ;    
  3317.     ?debug    L 719
  3318.     pop    di
  3319.     pop    si
  3320.     pop    ds
  3321.     pop    bp
  3322.     dec    bp
  3323.     ret    
  3324.     ?debug    C E6056946696C65040407000005695461736B040C+
  3325.     ?debug    C 060000
  3326.     ?debug    E
  3327.     ?debug    E
  3328. task_is_dead    endp
  3329.    ;    
  3330.    ;    tkern_program_started(HTASK    htaskNew)
  3331.    ;    
  3332.     ?debug    L 723
  3333.     assume    cs:PROCESS_TEXT,ds:DGROUP
  3334. _tkern_program_started    proc    far
  3335.     ?debug    B
  3336.     mov    ax,DGROUP
  3337.     inc    bp
  3338.     push    bp
  3339.     mov    bp,sp
  3340.     push    ds
  3341.     mov    ds,ax
  3342.     sub    sp,4
  3343.     push    si
  3344.     push    di
  3345.     ?debug    C E608687461736B4E6577180A06000000
  3346.     ?debug    B
  3347.    ;    
  3348.    ;    {
  3349.    ;        short    iEntry, i;
  3350.    ;        short    nPID;
  3351.    ;        BOOL    bOK;
  3352.    ;    
  3353.    ;        if (nProcesses == N_TKPROCS) // Should be impossible
  3354.    ;    
  3355.     ?debug    L 729
  3356.     cmp    word ptr DGROUP:nProcesses,100
  3357.     jne    short @13@86
  3358.    ;    
  3359.    ;            return;    // Well what else can we do?
  3360.    ;    
  3361.     ?debug    L 730
  3362.     jmp    @13@618
  3363. @13@86:
  3364.    ;    
  3365.    ;        iEntry = nProcesses++;
  3366.    ;    
  3367.     ?debug    L 731
  3368.     mov    di,word ptr DGROUP:nProcesses
  3369.     inc    word ptr DGROUP:nProcesses
  3370. @13@114:
  3371.    ;    
  3372.    ;        do
  3373.    ;        {
  3374.    ;            nPID = nPIDNext;
  3375.    ;    
  3376.     ?debug    L 734
  3377.     mov    ax,word ptr DGROUP:nPIDNext
  3378.     mov    word ptr [bp-4],ax
  3379.    ;    
  3380.    ;            bOK = TRUE;
  3381.    ;    
  3382.     ?debug    L 735
  3383.     mov    word ptr [bp-6],1
  3384.    ;    
  3385.    ;            for (i = 0; i < nProcesses; i++)
  3386.    ;    
  3387.     ?debug    L 736
  3388.     xor    si,si
  3389.     jmp    short @13@226
  3390. @13@142:
  3391.    ;    
  3392.    ;            {
  3393.    ;                if (_process[i].pid == nPID)
  3394.    ;    
  3395.     ?debug    L 738
  3396.     mov    bx,si
  3397.     imul    bx,bx,12
  3398.     mov    ax,word ptr DGROUP:__process[bx]
  3399.     cmp    ax,word ptr [bp-4]
  3400.     jne    short @13@198
  3401.    ;    
  3402.    ;                {
  3403.    ;                    bOK = FALSE;
  3404.    ;    
  3405.     ?debug    L 740
  3406.     mov    word ptr [bp-6],0
  3407.    ;    
  3408.    ;                    break;
  3409.    ;    
  3410.     ?debug    L 741
  3411.     jmp    short @13@254
  3412. @13@198:
  3413.     ?debug    L 736
  3414.     inc    si
  3415. @13@226:
  3416.     cmp    si,word ptr DGROUP:nProcesses
  3417.     jl    short @13@142
  3418. @13@254:
  3419.    ;    
  3420.    ;                }
  3421.    ;            }
  3422.    ;            if (bOK)
  3423.    ;    
  3424.     ?debug    L 744
  3425.     cmp    word ptr [bp-6],0
  3426.     je    short @13@422
  3427.    ;    
  3428.    ;            {
  3429.    ;                for (i = 0; i < nZombies; i++)
  3430.    ;    
  3431.     ?debug    L 746
  3432.     xor    si,si
  3433.     jmp    short @13@394
  3434. @13@310:
  3435.    ;    
  3436.    ;                {
  3437.    ;                    if (_zombies[i].pid == nPID)
  3438.    ;    
  3439.     ?debug    L 748
  3440.     mov    bx,si
  3441.     imul    bx,bx,12
  3442.     mov    ax,word ptr DGROUP:__zombies[bx]
  3443.     cmp    ax,word ptr [bp-4]
  3444.     jne    short @13@366
  3445.    ;    
  3446.    ;                    {
  3447.    ;                        bOK = FALSE;
  3448.    ;    
  3449.     ?debug    L 750
  3450.     mov    word ptr [bp-6],0
  3451.    ;    
  3452.    ;                        break;
  3453.    ;    
  3454.     ?debug    L 751
  3455.     jmp    short @13@422
  3456. @13@366:
  3457.     ?debug    L 746
  3458.     inc    si
  3459. @13@394:
  3460.     cmp    si,word ptr DGROUP:nZombies
  3461.     jl    short @13@310
  3462. @13@422:
  3463.    ;    
  3464.    ;                    }
  3465.    ;                }
  3466.    ;            }
  3467.    ;            inc_pid(&nPIDNext);
  3468.    ;    
  3469.     ?debug    L 755
  3470.     push    ds
  3471.     push    offset DGROUP:nPIDNext
  3472.     push    cs
  3473.     call    near ptr _inc_pid
  3474.     add    sp,4
  3475.    ;    
  3476.    ;        } while (!bOK);
  3477.    ;    
  3478.     ?debug    L 756
  3479.     cmp    word ptr [bp-6],0
  3480.     je    short @13@114
  3481.    ;    
  3482.    ;        _process[iEntry].pid = nPID;
  3483.    ;    
  3484.     ?debug    L 757
  3485.     mov    bx,di
  3486.     imul    bx,bx,12
  3487.     mov    ax,word ptr [bp-4]
  3488.     mov    word ptr DGROUP:__process[bx],ax
  3489.    ;    
  3490.    ;        _process[iEntry].hTask = htaskNew;
  3491.    ;    
  3492.     ?debug    L 758
  3493.     mov    bx,di
  3494.     imul    bx,bx,12
  3495.     mov    ax,word ptr [bp+6]
  3496.     mov    word ptr DGROUP:__process[bx+4],ax
  3497.    ;    
  3498.    ;        if (ptNext && !pidChild)
  3499.    ;    
  3500.     ?debug    L 759
  3501.     mov    ax,word ptr DGROUP:ptNext
  3502.     or    ax,word ptr DGROUP:ptNext+2
  3503.     je    short @13@562
  3504.     cmp    word ptr DGROUP:pidChild,0
  3505.     jne    short @13@562
  3506.    ;    
  3507.    ;        {
  3508.    ;            _process[iEntry].pidParent = pidParent;
  3509.    ;    
  3510.     ?debug    L 761
  3511.     mov    bx,di
  3512.     imul    bx,bx,12
  3513.     mov    ax,word ptr DGROUP:pidParent
  3514.     mov    word ptr DGROUP:__process[bx+2],ax
  3515.    ;    
  3516.    ;            _process[iEntry].hTaskParent = htaskParent;
  3517.    ;    
  3518.     ?debug    L 762
  3519.     mov    bx,di
  3520.     imul    bx,bx,12
  3521.     mov    ax,word ptr DGROUP:htaskParent
  3522.     mov    word ptr DGROUP:__process[bx+6],ax
  3523.    ;    
  3524.    ;            pidChild = nPID;
  3525.    ;    
  3526.     ?debug    L 763
  3527.     mov    ax,word ptr [bp-4]
  3528.     mov    word ptr DGROUP:pidChild,ax
  3529.    ;    
  3530.    ;            _process[iEntry].iParent = ptParent - _tasks;
  3531.    ;    
  3532.     ?debug    L 764
  3533.     push    0
  3534.     push    74
  3535.     mov    ax,word ptr DGROUP:ptParent
  3536.     xor    dx,dx
  3537.     sub    ax,offset DGROUP:__tasks
  3538.     sbb    dx,0
  3539.     push    dx
  3540.     push    ax
  3541.     call    far ptr F_LDIV@
  3542.     mov    bx,di
  3543.     imul    bx,bx,12
  3544.     mov    word ptr DGROUP:__process[bx+8],ax
  3545.    ;    
  3546.    ;        }
  3547.    ;    
  3548.     ?debug    L 765
  3549.     jmp    short @13@590
  3550. @13@562:
  3551.    ;    
  3552.    ;        else
  3553.    ;        {
  3554.    ;            _process[iEntry].pidParent = 1;
  3555.    ;    
  3556.     ?debug    L 768
  3557.     mov    bx,di
  3558.     imul    bx,bx,12
  3559.     mov    word ptr DGROUP:__process[bx+2],1
  3560.    ;    
  3561.    ;            _process[iEntry].hTaskParent = 0;
  3562.    ;    
  3563.     ?debug    L 769
  3564.     mov    bx,di
  3565.     imul    bx,bx,12
  3566.     mov    word ptr DGROUP:__process[bx+6],0
  3567.    ;    
  3568.    ;            _process[iEntry].iParent = -1;
  3569.    ;    
  3570.     ?debug    L 770
  3571.     mov    bx,di
  3572.     imul    bx,bx,12
  3573.     mov    word ptr DGROUP:__process[bx+8],-1
  3574. @13@590:
  3575.    ;    
  3576.    ;        }
  3577.    ;        pidCurrent = nPID;
  3578.    ;    
  3579.     ?debug    L 772
  3580.     mov    ax,word ptr [bp-4]
  3581.     mov    word ptr DGROUP:pidCurrent,ax
  3582. @13@618:
  3583.    ;    
  3584.    ;    }
  3585.    ;    
  3586.     ?debug    L 773
  3587.     pop    di
  3588.     pop    si
  3589.     pop    cx
  3590.     pop    cx
  3591.     pop    ds
  3592.     pop    bp
  3593.     dec    bp
  3594.     ret    
  3595.     ?debug    C E603624F4B0402FAFF0000046E5049440402FCFF+
  3596.     ?debug    C 0000016904040600000669456E74727904040700+
  3597.     ?debug    C 0008687461736B4E6577180A06000000
  3598.     ?debug    E
  3599.     ?debug    E
  3600. _tkern_program_started    endp
  3601.    ;    
  3602.    ;    tkern_program_dead(    HTASK    htaskCorpse,
  3603.    ;    
  3604.     ?debug    L 776
  3605.     assume    cs:PROCESS_TEXT,ds:DGROUP
  3606. _tkern_program_dead    proc    far
  3607.     ?debug    B
  3608.     mov    ax,DGROUP
  3609.     inc    bp
  3610.     push    bp
  3611.     mov    bp,sp
  3612.     push    ds
  3613.     mov    ds,ax
  3614.     sub    sp,2
  3615.     push    si
  3616.     push    di
  3617.     ?debug    C E6086E526574436F6465040A080000000B687461+
  3618.     ?debug    C 736B436F72707365180A06000000
  3619.     mov    di,word ptr [bp+6]
  3620.     ?debug    B
  3621.    ;    
  3622.    ;                int    nRetCode)
  3623.    ;    {
  3624.    ;        int    i;
  3625.    ;        short    nPID = 0;
  3626.    ;    
  3627.     ?debug    L 780
  3628.     mov    word ptr [bp-4],0
  3629.    ;    
  3630.    ;    
  3631.    ;        /* First, clean up the tkern data on the task, along with
  3632.    ;         * all open files.
  3633.    ;         */
  3634.    ;    
  3635.    ;        for (i = 0; i < TNTASK; i++)
  3636.    ;    
  3637.     ?debug    L 786
  3638.     xor    si,si
  3639.     jmp    short @14@198
  3640. @14@58:
  3641.    ;    
  3642.    ;        {
  3643.    ;            if (_tasks[i].hTask == htaskCorpse)
  3644.    ;    
  3645.     ?debug    L 788
  3646.     mov    bx,si
  3647.     imul    bx,bx,74
  3648.     cmp    word ptr DGROUP:__tasks[bx],di
  3649.     jne    short @14@170
  3650.    ;    
  3651.    ;            {
  3652.    ;                task_is_dead(i);
  3653.    ;    
  3654.     ?debug    L 790
  3655.     push    si
  3656.     push    cs
  3657.     call    near ptr task_is_dead
  3658.     pop    cx
  3659.    ;    
  3660.    ;                nTasks--;
  3661.    ;    
  3662.     ?debug    L 791
  3663.     dec    word ptr DGROUP:_nTasks
  3664.    ;    
  3665.    ;                if (!nTasks)
  3666.    ;    
  3667.     ?debug    L 792
  3668.     cmp    word ptr DGROUP:_nTasks,0
  3669.     jne    short @14@142
  3670.    ;    
  3671.    ;                    SendMessage(hwndManager, TKWM_ALLDONE, 0, 0);
  3672.    ;    
  3673.     ?debug    L 793
  3674.     push    word ptr DGROUP:_hwndManager
  3675.     push    1033
  3676.     push    0
  3677.     push    0
  3678.     push    0
  3679.     call    far ptr SENDMESSAGE
  3680. @14@142:
  3681.    ;    
  3682.    ;                break;
  3683.    ;    
  3684.     ?debug    L 794
  3685.     jmp    short @14@226
  3686. @14@170:
  3687.     ?debug    L 786
  3688.     inc    si
  3689. @14@198:
  3690.     cmp    si,20
  3691.     jl    short @14@58
  3692. @14@226:
  3693.    ;    
  3694.    ;            }
  3695.    ;        }
  3696.    ;    
  3697.    ;        /* Next, look for any children, and the process itself, in the process
  3698.    ;         * list.
  3699.    ;         */
  3700.    ;        for (i = 0; i < nProcesses; i++)
  3701.    ;    
  3702.     ?debug    L 801
  3703.     xor    si,si
  3704.     jmp    @14@506
  3705. @14@254:
  3706.    ;    
  3707.    ;        {
  3708.    ;            /* Change any orphaned processes to pidParent = 1, hTaskParent = 0 */
  3709.    ;            if (_process[i].hTaskParent == htaskCorpse)
  3710.    ;    
  3711.     ?debug    L 804
  3712.     mov    bx,si
  3713.     imul    bx,bx,12
  3714.     cmp    word ptr DGROUP:__process[bx+6],di
  3715.     jne    short @14@310
  3716.    ;    
  3717.    ;            {
  3718.    ;                /* A process has become orphaned */
  3719.    ;                _process[i].hTaskParent = 0;
  3720.    ;    
  3721.     ?debug    L 807
  3722.     mov    bx,si
  3723.     imul    bx,bx,12
  3724.     mov    word ptr DGROUP:__process[bx+6],0
  3725.    ;    
  3726.    ;                _process[i].pidParent = 1;
  3727.    ;    
  3728.     ?debug    L 808
  3729.     mov    bx,si
  3730.     imul    bx,bx,12
  3731.     mov    word ptr DGROUP:__process[bx+2],1
  3732.    ;    
  3733.    ;                _process[i].iParent = -1;
  3734.    ;    
  3735.     ?debug    L 809
  3736.     mov    bx,si
  3737.     imul    bx,bx,12
  3738.     mov    word ptr DGROUP:__process[bx+8],-1
  3739. @14@310:
  3740.    ;    
  3741.    ;            }
  3742.    ;    
  3743.    ;            if (_process[i].hTask == htaskCorpse)
  3744.    ;    
  3745.     ?debug    L 812
  3746.     mov    bx,si
  3747.     imul    bx,bx,12
  3748.     cmp    word ptr DGROUP:__process[bx+4],di
  3749.     je    @@8
  3750.     jmp    @14@478
  3751. @@8:
  3752.    ;    
  3753.    ;            {
  3754.    ;                /* This is the process entry for this task */
  3755.    ;                nPID = _process[i].pid;
  3756.    ;    
  3757.     ?debug    L 815
  3758.     mov    bx,si
  3759.     imul    bx,bx,12
  3760.     mov    ax,word ptr DGROUP:__process[bx]
  3761.     mov    word ptr [bp-4],ax
  3762.    ;    
  3763.    ;    
  3764.    ;                /* If there is room in the zombies table, and the process
  3765.    ;                 * has a living parent, copy the process entry to the zombies
  3766.    ;                 * table, and issue a wakeup call for any processes waiting
  3767.    ;                 * for children.
  3768.    ;                 *
  3769.    ;                 * note that if the process has no parents, failing to copy
  3770.    ;                 * it to the zombie table automatically causes it to be reaped.
  3771.    ;                 */
  3772.    ;                if (nZombies < N_TKPROCS && _process[i].iParent != -1)
  3773.    ;    
  3774.     ?debug    L 825
  3775.     cmp    word ptr DGROUP:nZombies,100
  3776.     jge    short @14@422
  3777.     mov    bx,si
  3778.     imul    bx,bx,12
  3779.     cmp    word ptr DGROUP:__process[bx+8],-1
  3780.     je    short @14@422
  3781.    ;    
  3782.    ;                {
  3783.    ;                    _zombies[nZombies] = _process[i];
  3784.    ;    
  3785.     ?debug    L 827
  3786.     mov    ax,word ptr DGROUP:nZombies
  3787.     imul    ax,ax,12
  3788.     add    ax,offset DGROUP:__zombies
  3789.     push    ds
  3790.     push    ax
  3791.     mov    ax,si
  3792.     imul    ax,ax,12
  3793.     add    ax,offset DGROUP:__process
  3794.     push    ds
  3795.     push    ax
  3796.     mov    cx,12
  3797.     call    far ptr F_SCOPY@
  3798.    ;    
  3799.    ;                    _zombies[nZombies].nRetCode = nRetCode;
  3800.    ;    
  3801.     ?debug    L 828
  3802.     mov    bx,word ptr DGROUP:nZombies
  3803.     imul    bx,bx,12
  3804.     mov    ax,word ptr [bp+8]
  3805.     mov    word ptr DGROUP:__zombies[bx+10],ax
  3806.    ;    
  3807.    ;                    _tasks[_process[i].iParent].nZombies++;
  3808.    ;    
  3809.     ?debug    L 829
  3810.     mov    bx,si
  3811.     imul    bx,bx,12
  3812.     mov    bx,word ptr DGROUP:__process[bx+8]
  3813.     imul    bx,bx,74
  3814.     inc    word ptr DGROUP:__tasks[bx+10]
  3815.    ;    
  3816.    ;                    nZombies++;
  3817.    ;    
  3818.     ?debug    L 830
  3819.     inc    word ptr DGROUP:nZombies
  3820.    ;    
  3821.    ;                    tkern_wakeup_call();
  3822.    ;    
  3823.     ?debug    L 831
  3824.     call    far ptr _tkern_wakeup_call
  3825. @14@422:
  3826.    ;    
  3827.    ;                }
  3828.    ;    
  3829.    ;                nProcesses--;
  3830.    ;    
  3831.     ?debug    L 834
  3832.     dec    word ptr DGROUP:nProcesses
  3833.    ;    
  3834.    ;                if (i != nProcesses)
  3835.    ;    
  3836.     ?debug    L 835
  3837.     cmp    si,word ptr DGROUP:nProcesses
  3838.     je    short @14@478
  3839.    ;    
  3840.    ;                {
  3841.    ;                    _process[i] = _process[nProcesses];
  3842.    ;    
  3843.     ?debug    L 837
  3844.     mov    ax,si
  3845.     imul    ax,ax,12
  3846.     add    ax,offset DGROUP:__process
  3847.     push    ds
  3848.     push    ax
  3849.     mov    ax,word ptr DGROUP:nProcesses
  3850.     imul    ax,ax,12
  3851.     add    ax,offset DGROUP:__process
  3852.     push    ds
  3853.     push    ax
  3854.     mov    cx,12
  3855.     call    far ptr F_SCOPY@
  3856.    ;    
  3857.    ;                    i--;
  3858.    ;    
  3859.     ?debug    L 838
  3860.     dec    si
  3861. @14@478:
  3862.     ?debug    L 801
  3863.     inc    si
  3864. @14@506:
  3865.     cmp    si,word ptr DGROUP:nProcesses
  3866.     jge    @@9
  3867.     jmp    @14@254
  3868. @@9:
  3869.    ;    
  3870.    ;                }
  3871.    ;            }
  3872.    ;        }
  3873.    ;    
  3874.    ;        /* Search for any zombie children of the current process and reap them */
  3875.    ;        for (i = 0; i < nZombies; i++)
  3876.    ;    
  3877.     ?debug    L 844
  3878.     xor    si,si
  3879.     jmp    short @14@674
  3880. @14@562:
  3881.    ;    
  3882.    ;        {
  3883.    ;            if (_zombies[i].pidParent == nPID)
  3884.    ;    
  3885.     ?debug    L 846
  3886.     mov    bx,si
  3887.     imul    bx,bx,12
  3888.     mov    ax,word ptr DGROUP:__zombies[bx+2]
  3889.     cmp    ax,word ptr [bp-4]
  3890.     jne    short @14@646
  3891.    ;    
  3892.    ;            {
  3893.    ;                nZombies--;
  3894.    ;    
  3895.     ?debug    L 848
  3896.     dec    word ptr DGROUP:nZombies
  3897.    ;    
  3898.    ;                if (i != nZombies)
  3899.    ;    
  3900.     ?debug    L 849
  3901.     cmp    si,word ptr DGROUP:nZombies
  3902.     je    short @14@646
  3903.    ;    
  3904.    ;                {
  3905.    ;                    _zombies[i] = _zombies[nZombies];
  3906.    ;    
  3907.     ?debug    L 851
  3908.     mov    ax,si
  3909.     imul    ax,ax,12
  3910.     add    ax,offset DGROUP:__zombies
  3911.     push    ds
  3912.     push    ax
  3913.     mov    ax,word ptr DGROUP:nZombies
  3914.     imul    ax,ax,12
  3915.     add    ax,offset DGROUP:__zombies
  3916.     push    ds
  3917.     push    ax
  3918.     mov    cx,12
  3919.     call    far ptr F_SCOPY@
  3920.    ;    
  3921.    ;                    i--;
  3922.    ;    
  3923.     ?debug    L 852
  3924.     dec    si
  3925. @14@646:
  3926.     ?debug    L 844
  3927.     inc    si
  3928. @14@674:
  3929.     cmp    si,word ptr DGROUP:nZombies
  3930.     jl    short @14@562
  3931.    ;    
  3932.    ;                }
  3933.    ;            }
  3934.    ;        }
  3935.    ;    }
  3936.    ;    
  3937.     ?debug    L 856
  3938.     pop    di
  3939.     pop    si
  3940.     pop    cx
  3941.     pop    ds
  3942.     pop    bp
  3943.     dec    bp
  3944.     ret    
  3945.     ?debug    C E6046E5049440402FCFF0000016904040600000B+
  3946.     ?debug    C 687461736B436F72707365180C070000086E5265+
  3947.     ?debug    C 74436F6465040A08000000
  3948.     ?debug    E
  3949.     ?debug    E
  3950. _tkern_program_dead    endp
  3951.    ;    
  3952.    ;    process_init(void)
  3953.    ;    
  3954.     ?debug    L 860
  3955.     assume    cs:PROCESS_TEXT,ds:DGROUP
  3956. _process_init    proc    far
  3957.     ?debug    B
  3958.     mov    ax,DGROUP
  3959.     inc    bp
  3960.     push    bp
  3961.     mov    bp,sp
  3962.     push    ds
  3963.     mov    ds,ax
  3964.     sub    sp,42
  3965.     push    si
  3966.     push    di
  3967.     ?debug    B
  3968.    ;    
  3969.    ;    {
  3970.    ;        TASKENTRY te;
  3971.    ;        HTASK    htaskNow;
  3972.    ;        int    i, j;
  3973.    ;    
  3974.    ;        for (i = 0; i < TNTASK; i++)
  3975.    ;    
  3976.     ?debug    L 866
  3977.     xor    si,si
  3978.     jmp    short @15@198
  3979. @15@58:
  3980.    ;    
  3981.    ;        {
  3982.    ;            _tasks[i].hTask = 0;
  3983.    ;    
  3984.     ?debug    L 868
  3985.     mov    bx,si
  3986.     imul    bx,bx,74
  3987.     mov    word ptr DGROUP:__tasks[bx],0
  3988.    ;    
  3989.    ;            _tasks[i].argv = 0;
  3990.    ;    
  3991.     ?debug    L 869
  3992.     mov    bx,si
  3993.     imul    bx,bx,74
  3994.     mov    word ptr DGROUP:__tasks[bx+54],0
  3995.     mov    word ptr DGROUP:__tasks[bx+52],0
  3996.    ;    
  3997.    ;            _tasks[i].envp = 0;
  3998.    ;    
  3999.     ?debug    L 870
  4000.     mov    bx,si
  4001.     imul    bx,bx,74
  4002.     mov    word ptr DGROUP:__tasks[bx+58],0
  4003.     mov    word ptr DGROUP:__tasks[bx+56],0
  4004.    ;    
  4005.    ;            _tasks[i].pid = 0;
  4006.    ;    
  4007.     ?debug    L 871
  4008.     mov    bx,si
  4009.     imul    bx,bx,74
  4010.     mov    word ptr DGROUP:__tasks[bx+2],0
  4011.    ;    
  4012.    ;            _tasks[i].nChildren = 0;
  4013.    ;    
  4014.     ?debug    L 872
  4015.     mov    bx,si
  4016.     imul    bx,bx,74
  4017.     mov    word ptr DGROUP:__tasks[bx+8],0
  4018.    ;    
  4019.    ;            _tasks[i].nZombies = 0;
  4020.    ;    
  4021.     ?debug    L 873
  4022.     mov    bx,si
  4023.     imul    bx,bx,74
  4024.     mov    word ptr DGROUP:__tasks[bx+10],0
  4025.    ;    
  4026.    ;            _tasks[i].iFledgeling = -1;
  4027.    ;    
  4028.     ?debug    L 874
  4029.     mov    bx,si
  4030.     imul    bx,bx,74
  4031.     mov    word ptr DGROUP:__tasks[bx+4],-1
  4032.    ;    
  4033.    ;            for (j = 0; j < UFILE_MAX; j++)
  4034.    ;    
  4035.     ?debug    L 875
  4036.     xor    di,di
  4037.     jmp    short @15@142
  4038. @15@86:
  4039.    ;    
  4040.    ;                _tasks[i].files[j] = -1;
  4041.    ;    
  4042.     ?debug    L 876
  4043.     mov    bx,si
  4044.     imul    bx,bx,74
  4045.     mov    ax,di
  4046.     add    ax,ax
  4047.     add    bx,ax
  4048.     mov    word ptr DGROUP:__tasks[bx+12],-1
  4049.     ?debug    L 875
  4050.     inc    di
  4051. @15@142:
  4052.     cmp    di,20
  4053.     jl    short @15@86
  4054.     ?debug    L 866
  4055.     inc    si
  4056. @15@198:
  4057.     cmp    si,20
  4058.     jl    short @15@58
  4059.    ;    
  4060.    ;        }
  4061.    ;        htaskNow = GetCurrentTask();
  4062.    ;    
  4063.     ?debug    L 878
  4064.     call    far ptr GETCURRENTTASK
  4065.     mov    word ptr [bp-4],ax
  4066.    ;    
  4067.    ;        te.dwSize = sizeof(TASKENTRY);
  4068.    ;    
  4069.     ?debug    L 879
  4070.     mov    word ptr [bp-42],0
  4071.     mov    word ptr [bp-44],40
  4072.    ;    
  4073.    ;        TaskFirst(&te);
  4074.    ;    
  4075.     ?debug    L 880
  4076.     push    ss
  4077.     lea    ax,word ptr [bp-44]
  4078.     push    ax
  4079.     call    far ptr TASKFIRST
  4080.    ;    
  4081.    ;        memset(_process, 0, sizeof(_process));
  4082.    ;    
  4083.     ?debug    L 881
  4084.     push    1200
  4085.     push    0
  4086.     push    ds
  4087.     push    offset DGROUP:__process
  4088.     call    far ptr _memset
  4089.     add    sp,8
  4090.    ;    
  4091.    ;        memset(_zombies, 0, sizeof(_zombies));
  4092.    ;    
  4093.     ?debug    L 882
  4094.     push    1200
  4095.     push    0
  4096.     push    ds
  4097.     push    offset DGROUP:__zombies
  4098.     call    far ptr _memset
  4099.     add    sp,8
  4100. @15@254:
  4101.    ;    
  4102.    ;        do
  4103.    ;        {
  4104.    ;            if (htaskNow == te.hTask)
  4105.    ;    
  4106.     ?debug    L 885
  4107.     mov    ax,word ptr [bp-4]
  4108.     cmp    ax,word ptr [bp-40]
  4109.     jne    short @15@310
  4110.    ;    
  4111.    ;                pidCurrent = nPIDNext;
  4112.    ;    
  4113.     ?debug    L 886
  4114.     mov    ax,word ptr DGROUP:nPIDNext
  4115.     mov    word ptr DGROUP:pidCurrent,ax
  4116. @15@310:
  4117.    ;    
  4118.    ;            _process[nProcesses].pid = nPIDNext++;
  4119.    ;    
  4120.     ?debug    L 887
  4121.     mov    bx,word ptr DGROUP:nProcesses
  4122.     imul    bx,bx,12
  4123.     mov    ax,word ptr DGROUP:nPIDNext
  4124.     mov    word ptr DGROUP:__process[bx],ax
  4125.     inc    word ptr DGROUP:nPIDNext
  4126.    ;    
  4127.    ;            _process[nProcesses].pidParent = 1;
  4128.    ;    
  4129.     ?debug    L 888
  4130.     mov    bx,word ptr DGROUP:nProcesses
  4131.     imul    bx,bx,12
  4132.     mov    word ptr DGROUP:__process[bx+2],1
  4133.    ;    
  4134.    ;            _process[nProcesses].hTaskParent = 0;
  4135.    ;    
  4136.     ?debug    L 889
  4137.     mov    bx,word ptr DGROUP:nProcesses
  4138.     imul    bx,bx,12
  4139.     mov    word ptr DGROUP:__process[bx+6],0
  4140.    ;    
  4141.    ;            _process[nProcesses].hTask = te.hTask;
  4142.    ;    
  4143.     ?debug    L 890
  4144.     mov    bx,word ptr DGROUP:nProcesses
  4145.     imul    bx,bx,12
  4146.     mov    ax,word ptr [bp-40]
  4147.     mov    word ptr DGROUP:__process[bx+4],ax
  4148.    ;    
  4149.    ;            _process[nProcesses].iParent = -1;
  4150.    ;    
  4151.     ?debug    L 891
  4152.     mov    bx,word ptr DGROUP:nProcesses
  4153.     imul    bx,bx,12
  4154.     mov    word ptr DGROUP:__process[bx+8],-1
  4155.    ;    
  4156.    ;            nProcesses++;
  4157.    ;    
  4158.     ?debug    L 892
  4159.     inc    word ptr DGROUP:nProcesses
  4160.    ;    
  4161.    ;        } while (TaskNext(&te));
  4162.    ;    
  4163.     ?debug    L 893
  4164.     push    ss
  4165.     lea    ax,word ptr [bp-44]
  4166.     push    ax
  4167.     call    far ptr TASKNEXT
  4168.     or    ax,ax
  4169.     jne    short @15@254
  4170.    ;    
  4171.    ;    }
  4172.    ;    
  4173.     ?debug    L 894
  4174.     pop    di
  4175.     pop    si
  4176.     lea    sp,word ptr [bp-2]
  4177.     pop    ds
  4178.     pop    bp
  4179.     dec    bp
  4180.     ret    
  4181.     ?debug    C E6016A0404070000016904040600000868746173+
  4182.     ?debug    C 6B4E6F771802FCFF00000274653102D4FF0000
  4183.     ?debug    E
  4184.     ?debug    E
  4185. _process_init    endp
  4186.    ;    
  4187.    ;    tkern_kill(    int    pid,
  4188.    ;    
  4189.     ?debug    L 898
  4190.     assume    cs:PROCESS_TEXT,ds:DGROUP
  4191. _tkern_kill    proc    far
  4192.     ?debug    B
  4193.     mov    ax,DGROUP
  4194.     inc    bp
  4195.     push    bp
  4196.     mov    bp,sp
  4197.     push    ds
  4198.     mov    ds,ax
  4199.     sub    sp,4
  4200.     push    si
  4201.     push    di
  4202.     ?debug    C E6076E5369676E616C040A080000000370696404+
  4203.     ?debug    C 0A06000000
  4204.     mov    di,word ptr [bp+6]
  4205.     ?debug    B
  4206.    ;    
  4207.    ;            int    nSignal)
  4208.    ;    {
  4209.    ;        int    i;
  4210.    ;        struct    task *pt;
  4211.    ;    
  4212.    ;        pt = GetTaskInfo();
  4213.    ;    
  4214.     ?debug    L 904
  4215.     push    cs
  4216.     call    near ptr _GetTaskInfo
  4217.     mov    word ptr [bp-4],dx
  4218.     mov    word ptr [bp-6],ax
  4219.    ;    
  4220.    ;    
  4221.    ;        for (i = 0; i < nProcesses; i++)
  4222.    ;    
  4223.     ?debug    L 906
  4224.     xor    si,si
  4225.     jmp    short @16@338
  4226. @16@58:
  4227.    ;    
  4228.    ;        {
  4229.    ;            if (_process[i].pid == pid)
  4230.    ;    
  4231.     ?debug    L 908
  4232.     mov    bx,si
  4233.     imul    bx,bx,12
  4234.     cmp    word ptr DGROUP:__process[bx],di
  4235.     jne    short @16@310
  4236.    ;    
  4237.    ;            {
  4238.    ;                switch(nSignal)
  4239.    ;    
  4240.     ?debug    L 910
  4241.     mov    bx,word ptr [bp+8]
  4242.     cmp    bx,14
  4243.     ja    short @16@226
  4244.     add    bx,bx
  4245.     jmp    word ptr cs:@16@C690[bx]
  4246. @16@170:
  4247.    ;    
  4248.    ;                {
  4249.    ;                case 0:
  4250.    ;                    break;
  4251.    ;    
  4252.     ?debug    L 913
  4253.     jmp    short @16@282
  4254. @16@198:
  4255.    ;    
  4256.    ;                case 1:
  4257.    ;                case 2:
  4258.    ;                case 9:
  4259.    ;                case 14:
  4260.    ;                    TerminateApp(_process[i].hTask, NO_UAE_BOX);
  4261.    ;    
  4262.     ?debug    L 918
  4263.     mov    bx,si
  4264.     imul    bx,bx,12
  4265.     push    word ptr DGROUP:__process[bx+4]
  4266.     push    1
  4267.     jmp    short @16@254
  4268. @16@226:
  4269.    ;    
  4270.    ;                    break;
  4271.    ;    
  4272.    ;                default:
  4273.    ;                    TerminateApp(_process[i].hTask, UAE_BOX);
  4274.    ;    
  4275.     ?debug    L 922
  4276.     mov    bx,si
  4277.     imul    bx,bx,12
  4278.     push    word ptr DGROUP:__process[bx+4]
  4279.     push    0
  4280. @16@254:
  4281.     call    far ptr TERMINATEAPP
  4282.    ;    
  4283.    ;                    break;
  4284.    ;    
  4285.     ?debug    L 923
  4286.     jmp    short @16@282
  4287. @16@282:
  4288.     jmp    short @16@422
  4289. @16@310:
  4290.     ?debug    L 906
  4291.     inc    si
  4292. @16@338:
  4293.     cmp    si,word ptr DGROUP:nProcesses
  4294.     jl    short @16@58
  4295.    ;    
  4296.    ;                }
  4297.    ;                return 0;
  4298.    ;            }
  4299.    ;        }
  4300.    ;        for (i = 0; i < nZombies; i++)
  4301.    ;    
  4302.     ?debug    L 928
  4303.     xor    si,si
  4304.     jmp    short @16@478
  4305. @16@394:
  4306.    ;    
  4307.    ;        {
  4308.    ;            if (_process[i].pid == pid)
  4309.    ;    
  4310.     ?debug    L 930
  4311.     mov    bx,si
  4312.     imul    bx,bx,12
  4313.     cmp    word ptr DGROUP:__process[bx],di
  4314.     jne    short @16@450
  4315. @16@422:
  4316.    ;    
  4317.    ;                return 0;    /* Can't kill the undead */
  4318.    ;    
  4319.     ?debug    L 931
  4320.     xor    ax,ax
  4321.     jmp    short @16@562
  4322. @16@450:
  4323.     ?debug    L 928
  4324.     inc    si
  4325. @16@478:
  4326.     cmp    si,word ptr DGROUP:nZombies
  4327.     jl    short @16@394
  4328.    ;    
  4329.    ;        }
  4330.    ;        pt->nError = EFAULT;
  4331.    ;    
  4332.     ?debug    L 933
  4333.     les    bx,dword ptr [bp-6]
  4334.     mov    word ptr es:[bx+62],14
  4335.    ;    
  4336.    ;        return -1;
  4337.    ;    
  4338.     ?debug    L 934
  4339.     mov    ax,-1
  4340.     jmp    short @16@562
  4341. @16@562:
  4342.    ;    
  4343.    ;    }
  4344.    ;    
  4345.     ?debug    L 935
  4346.     pop    di
  4347.     pop    si
  4348.     pop    cx
  4349.     pop    cx
  4350.     pop    ds
  4351.     pop    bp
  4352.     dec    bp
  4353.     ret    
  4354.     ?debug    C E60270741E02FAFF000001690404060000037069+
  4355.     ?debug    C 64040C070000076E5369676E616C040A08000000
  4356.     ?debug    E
  4357.     ?debug    E
  4358. _tkern_kill    endp
  4359. @16@C690    label    word
  4360.     dw    @16@170
  4361.     dw    @16@198
  4362.     dw    @16@198
  4363.     dw    @16@226
  4364.     dw    @16@226
  4365.     dw    @16@226
  4366.     dw    @16@226
  4367.     dw    @16@226
  4368.     dw    @16@226
  4369.     dw    @16@198
  4370.     dw    @16@226
  4371.     dw    @16@226
  4372.     dw    @16@226
  4373.     dw    @16@226
  4374.     dw    @16@198
  4375.    ;    
  4376.    ;    tkern_register_sighandler(void far pascal (*_proc)(int))
  4377.    ;    
  4378.     ?debug    L 941
  4379.     assume    cs:PROCESS_TEXT,ds:DGROUP
  4380. _tkern_register_sighandler    proc    far
  4381.     ?debug    B
  4382.     mov    ax,DGROUP
  4383.     inc    bp
  4384.     push    bp
  4385.     mov    bp,sp
  4386.     push    ds
  4387.     mov    ds,ax
  4388.     sub    sp,4
  4389.     ?debug    C E33700000023010500
  4390.     ?debug    C E336000400163700
  4391.     ?debug    C E6055F70726F63360A06000000
  4392.     ?debug    B
  4393.    ;    
  4394.    ;    {
  4395.    ;        struct    task *pt;
  4396.    ;    
  4397.    ;        pt = GetTaskInfo();
  4398.    ;    
  4399.     ?debug    L 945
  4400.     push    cs
  4401.     call    near ptr _GetTaskInfo
  4402.     mov    word ptr [bp-4],dx
  4403.     mov    word ptr [bp-6],ax
  4404.    ;    
  4405.    ;        pt->intrproc = _proc;
  4406.    ;    
  4407.     ?debug    L 946
  4408.     les    bx,dword ptr [bp-6]
  4409.     mov    dx,word ptr [bp+8]
  4410.     mov    ax,word ptr [bp+6]
  4411.     mov    word ptr es:[bx+72],dx
  4412.     mov    word ptr es:[bx+70],ax
  4413.    ;    
  4414.    ;    }
  4415.    ;    
  4416.     ?debug    L 947
  4417.     pop    cx
  4418.     pop    cx
  4419.     pop    ds
  4420.     pop    bp
  4421.     dec    bp
  4422.     ret    
  4423.     ?debug    C E60270741E02FAFF0000055F70726F63360A0600+
  4424.     ?debug    C 0000
  4425.     ?debug    E
  4426.     ?debug    E
  4427. _tkern_register_sighandler    endp
  4428.    ;    
  4429.    ;    tkern_deliver_signal(    int    nDevice,
  4430.    ;    
  4431.     ?debug    L 950
  4432.     assume    cs:PROCESS_TEXT,ds:DGROUP
  4433. _tkern_deliver_signal    proc    far
  4434.     ?debug    B
  4435.     mov    ax,DGROUP
  4436.     inc    bp
  4437.     push    bp
  4438.     mov    bp,sp
  4439.     push    ds
  4440.     mov    ds,ax
  4441.     sub    sp,2
  4442.     push    si
  4443.     push    di
  4444.     ?debug    C E6076E5369676E616C040A0A000000056E46696C+
  4445.     ?debug    C 65040A08000000076E446576696365040A060000+
  4446.     ?debug    C 00
  4447.     ?debug    B
  4448.    ;    
  4449.    ;                int    nFile,
  4450.    ;                int    nSignal)
  4451.    ;    {
  4452.    ;        /* Find any task which is attached to the file and device,
  4453.    ;         * and set its nSignal to the value supplied.
  4454.    ;         */
  4455.    ;    
  4456.    ;        int    idFile;
  4457.    ;        int    iTask;
  4458.    ;        int    iPTF;
  4459.    ;    
  4460.    ;        for (idFile = 0; idFile < TNFILE; idFile++)
  4461.    ;    
  4462.     ?debug    L 962
  4463.     xor    di,di
  4464.     jmp    short @18@170
  4465. @18@58:
  4466.    ;    
  4467.    ;        {
  4468.    ;            if (_files[idFile].tf_dev == nDevice &&
  4469.    ;    
  4470.     ?debug    L 964
  4471.    ;    
  4472.    ;                _files[idFile].tf_id == nFile)
  4473.    ;    
  4474.     ?debug    L 965
  4475.     mov    bx,di
  4476.     shl    bx,3
  4477.     mov    ax,word ptr DGROUP:__files[bx+4]
  4478.     cmp    ax,word ptr [bp+6]
  4479.     jne    short @18@142
  4480.     mov    bx,di
  4481.     shl    bx,3
  4482.     mov    ax,word ptr DGROUP:__files[bx]
  4483.     cmp    ax,word ptr [bp+8]
  4484.     jne    short @18@142
  4485.    ;    
  4486.    ;            {
  4487.    ;                break;
  4488.    ;    
  4489.     ?debug    L 967
  4490.     jmp    short @18@198
  4491. @18@142:
  4492.     ?debug    L 962
  4493.     inc    di
  4494. @18@170:
  4495.     cmp    di,50
  4496.     jl    short @18@58
  4497. @18@198:
  4498.    ;    
  4499.    ;            }
  4500.    ;        }
  4501.    ;        if (idFile == TNFILE)
  4502.    ;    
  4503.     ?debug    L 970
  4504.     cmp    di,50
  4505.     jne    short @18@254
  4506.    ;    
  4507.    ;            return;        /* Shouldn't be possible */
  4508.    ;    
  4509.     ?debug    L 971
  4510.     jmp    short @18@590
  4511. @18@254:
  4512.    ;    
  4513.    ;        for (iTask = 0; iTask < TNTASK; iTask++)
  4514.    ;    
  4515.     ?debug    L 972
  4516.     xor    si,si
  4517.     jmp    short @18@562
  4518. @18@282:
  4519.    ;    
  4520.    ;        {
  4521.    ;            for (iPTF = 0; iPTF < UFILE_MAX; iPTF++)
  4522.    ;    
  4523.     ?debug    L 974
  4524.     mov    word ptr [bp-4],0
  4525.     jmp    short @18@506
  4526. @18@310:
  4527.    ;    
  4528.    ;            {
  4529.    ;                if (_tasks[iTask].files[iPTF] == idFile)
  4530.    ;    
  4531.     ?debug    L 976
  4532.     mov    bx,si
  4533.     imul    bx,bx,74
  4534.     mov    ax,word ptr [bp-4]
  4535.     add    ax,ax
  4536.     add    bx,ax
  4537.     cmp    word ptr DGROUP:__tasks[bx+12],di
  4538.     jne    short @18@478
  4539.    ;    
  4540.    ;                {
  4541.    ;                    if (!_tasks[iTask].intrproc)
  4542.    ;    
  4543.     ?debug    L 978
  4544.     mov    bx,si
  4545.     imul    bx,bx,74
  4546.     mov    ax,word ptr DGROUP:__tasks[bx+70]
  4547.     or    ax,word ptr DGROUP:__tasks[bx+72]
  4548.     jne    short @18@394
  4549.    ;    
  4550.    ;                        continue;
  4551.    ;    
  4552.     ?debug    L 979
  4553.     jmp    short @18@478
  4554. @18@394:
  4555.    ;    
  4556.    ;                    _tasks[iTask].nSignal = nSignal;
  4557.    ;    
  4558.     ?debug    L 980
  4559.     mov    bx,si
  4560.     imul    bx,bx,74
  4561.     mov    ax,word ptr [bp+10]
  4562.     mov    word ptr DGROUP:__tasks[bx+64],ax
  4563.    ;    
  4564.    ;                    if (!(_tasks[iTask].nFlags & TF_ASLEEP))
  4565.    ;    
  4566.     ?debug    L 981
  4567.     mov    bx,si
  4568.     imul    bx,bx,74
  4569.     test    byte ptr DGROUP:__tasks[bx+60],1
  4570.     jne    short @18@450
  4571.    ;    
  4572.    ;                        continue;
  4573.    ;    
  4574.     ?debug    L 982
  4575.     jmp    short @18@478
  4576. @18@450:
  4577.    ;    
  4578.    ;                    PostAppMessage(_tasks[iTask].hTask, TKWM_WAKEUP, 0, 0);
  4579.    ;    
  4580.     ?debug    L 983
  4581.     mov    bx,si
  4582.     imul    bx,bx,74
  4583.     push    word ptr DGROUP:__tasks[bx]
  4584.     push    1124
  4585.     push    0
  4586.     push    0
  4587.     push    0
  4588.     call    far ptr POSTAPPMESSAGE
  4589. @18@478:
  4590.     ?debug    L 974
  4591.     inc    word ptr [bp-4]
  4592. @18@506:
  4593.     cmp    word ptr [bp-4],20
  4594.     jl    short @18@310
  4595.     ?debug    L 972
  4596.     inc    si
  4597. @18@562:
  4598.     cmp    si,20
  4599.     jl    short @18@282
  4600. @18@590:
  4601.    ;    
  4602.    ;                }
  4603.    ;            }
  4604.    ;        }
  4605.    ;    }
  4606.    ;    
  4607.     ?debug    L 987
  4608.     pop    di
  4609.     pop    si
  4610.     pop    cx
  4611.     pop    ds
  4612.     pop    bp
  4613.     dec    bp
  4614.     ret    
  4615.     ?debug    C E604695054460402FCFF000005695461736B0404+
  4616.     ?debug    C 06000006696446696C650404070000076E446576+
  4617.     ?debug    C 696365040A06000000056E46696C65040A080000+
  4618.     ?debug    C 00076E5369676E616C040A0A000000
  4619.     ?debug    E
  4620.     ?debug    E
  4621. _tkern_deliver_signal    endp
  4622. PROCESS_TEXT    ends
  4623. _BSS    segment word public 'BSS'
  4624. __tasks    label    word
  4625.     db    1480 dup (?)
  4626. __process    label    word
  4627.     db    1200 dup (?)
  4628. __zombies    label    word
  4629.     db    1200 dup (?)
  4630. pidCurrent    label    word
  4631.     db    2 dup (?)
  4632.     ?debug    C E9
  4633.     ?debug    C FA00000000
  4634. _BSS    ends
  4635. _DATA    segment word public 'DATA'
  4636. s@    label    byte
  4637.     db    ' '
  4638.     db    0
  4639.     db    'Files are all mixed up in exec'
  4640.     db    0
  4641.     db    'Task is not a fledgeling'
  4642.     db    0
  4643.     db    'I set a NULL ptNext!'
  4644.     db    0
  4645.     db    'WinExec returned an error'
  4646.     db    0
  4647.     db    'ptNext has been tampered with (!= pt)'
  4648.     db    0
  4649.     db    'ptNext does not match ptLast in tkexec'
  4650.     db    0
  4651.     db    'Task has not registered'
  4652.     db    0
  4653.     db    'Task entry has null hTask'
  4654.     db    0
  4655.     db    'Files are all mixed up'
  4656.     db    0
  4657.     db    'iFledgeling is not -1'
  4658.     db    0
  4659.     db    'File 0 is -1'
  4660.     db    0
  4661.     db    'File 0 is invalid'
  4662.     db    0
  4663.     db    'File 1 is invalid'
  4664.     db    0
  4665.     db    'File 2 is invalid'
  4666.     db    0
  4667.     db    'ptNext: %p, ptLast: %p'
  4668.     db    0
  4669.     db    'In: %d, Out: %d'
  4670.     db    0
  4671.     db    'Somebody has touched my hTask!'
  4672.     db    0
  4673.     db    'pt != GetTaskInfo()'
  4674.     db    0
  4675.     db    'Created from %p'
  4676.     db    0
  4677.     db    'GetTaskInfo() is smaller'
  4678.     db    0
  4679.     db    'GetTaskInfo() is larger'
  4680.     db    0
  4681.     db    'Ummm... htaskParent exists'
  4682.     db    0
  4683.     db    'My te.htaskParent is 0'
  4684.     db    0
  4685.     db    'I'
  4686.     db    39
  4687.     db    'm a bastard: htaskParent = %04x'
  4688.     db    0
  4689.     db    'Reaping task'
  4690.     db    0
  4691. _DATA    ends
  4692. PROCESS_TEXT    segment word public 'CODE'
  4693. PROCESS_TEXT    ends
  4694. _s@    equ    s@
  4695.     extrn    _sprintf:far
  4696.     extrn    WINEXEC:far
  4697.     extrn    GETCURRENTTASK:far
  4698.     extrn    SENDMESSAGE:far
  4699.     extrn    POSTAPPMESSAGE:far
  4700.     extrn    MESSAGEBOX:far
  4701.     extrn    TASKFIRST:far
  4702.     extrn    TASKNEXT:far
  4703.     extrn    TASKFINDHANDLE:far
  4704.     extrn    TERMINATEAPP:far
  4705.     extrn    _free:far
  4706.     extrn    _malloc:far
  4707.     extrn    _memcpy:far
  4708.     extrn    _memset:far
  4709.     extrn    _strcat:far
  4710.     extrn    _strcpy:far
  4711.     extrn    _strlen:far
  4712.     extrn    __files:word
  4713.     public    __tasks
  4714.     extrn    _tkern_wakeup_call:far
  4715.     extrn    _GetMessages:far
  4716.     extrn    _FlushMessages:far
  4717.     extrn    _Copy_Array:far
  4718.     public    _GetTaskInfo
  4719.     public    _process_init
  4720.     extrn    _internal_close:far
  4721.     public    _nTasks
  4722.     extrn    _hwndManager:word
  4723.     public    __process
  4724.     public    __zombies
  4725. _nProcesses    equ    nProcesses
  4726. _nZombies    equ    nZombies
  4727. _ptNext    equ    ptNext
  4728. _ptLast    equ    ptLast
  4729. _ptParent    equ    ptParent
  4730. _htaskParent    equ    htaskParent
  4731. _pidParent    equ    pidParent
  4732. _pidChild    equ    pidChild
  4733. _pidCurrent    equ    pidCurrent
  4734. _nPIDNext    equ    nPIDNext
  4735. _task_is_dead    equ    task_is_dead
  4736.     public    _inc_pid
  4737. _aiExecErrors    equ    aiExecErrors
  4738.     public    _nTKExecIn
  4739.     public    _nTKExecOut
  4740.     publicdll    _tkern_exec
  4741.     extrn    F_LDIV@:far
  4742.     publicdll    _tkern_wait
  4743.     extrn    F_SCOPY@:far
  4744.     publicdll    _tkern_wait3
  4745.     publicdll    _tkern_waitpid
  4746.     publicdll    _tkern_fork
  4747.     publicdll    _tkern_total_zombies
  4748.     publicdll    _tkern_list_zombies
  4749.     publicdll    _tkern_get_process
  4750.     extrn    _tkern_valid_file:far
  4751.     publicdll    _tkern_register_program
  4752.     publicdll    _tkern_program_started
  4753.     publicdll    _tkern_program_dead
  4754.     publicdll    _tkern_kill
  4755.     publicdll    _tkern_register_sighandler
  4756.     publicdll    _tkern_deliver_signal
  4757.     ?debug    C EA010C
  4758.     ?debug    C E338000000231D0401
  4759.     ?debug    C EB085F737072696E7466380000
  4760.     ?debug    C E339000000230A0500
  4761.     ?debug    C EB0757494E45584543390000
  4762.     ?debug    C E33A00000023180500
  4763.     ?debug    C EB0E47455443555252454E545441534B3A0000
  4764.     ?debug    C E33B00000023060500
  4765.     ?debug    C EB0B53454E444D4553534147453B0000
  4766.     ?debug    C E33C00000023040500
  4767.     ?debug    C EB0E504F53544150504D4553534147453C0000
  4768.     ?debug    C E33D00000023040500
  4769.     ?debug    C EB0A4D455353414745424F583D0000
  4770.     ?debug    C E33E00000023040500
  4771.     ?debug    C EB095441534B46495253543E0000
  4772.     ?debug    C E33F00000023040500
  4773.     ?debug    C EB085441534B4E4558543F0000
  4774.     ?debug    C E34000000023040500
  4775.     ?debug    C EB0E5441534B46494E4448414E444C45400000
  4776.     ?debug    C E34100000023010500
  4777.     ?debug    C EB0C5445524D494E415445415050410000
  4778.     ?debug    C E34200000023010400
  4779.     ?debug    C EB055F66726565420000
  4780.     ?debug    C E343000000231C0400
  4781.     ?debug    C EB075F6D616C6C6F63430000
  4782.     ?debug    C E344000000231C0400
  4783.     ?debug    C EB075F6D656D637079440000
  4784.     ?debug    C E345000000231C0400
  4785.     ?debug    C EB075F6D656D736574450000
  4786.     ?debug    C E346000000231D0400
  4787.     ?debug    C EB075F737472636174460000
  4788.     ?debug    C E347000000231D0400
  4789.     ?debug    C EB075F737472637079470000
  4790.     ?debug    C E348000000230A0400
  4791.     ?debug    C EB075F7374726C656E480000
  4792.     ?debug    C E34A057466696C6508001E3B
  4793.     ?debug    C E3490000001A4A
  4794.     ?debug    C EB075F5F66696C6573490000
  4795.     ?debug    C E34B00C8051A1F
  4796.     ?debug    C EC075F5F7461736B734B000000
  4797.     ?debug    C E34C00000023010400
  4798.     ?debug    C EB125F746B65726E5F77616B6575705F63616C6C+
  4799.     ?debug    C 4C0000
  4800.     ?debug    C E34D00000023010400
  4801.     ?debug    C EB0C5F4765744D657373616765734D0000
  4802.     ?debug    C E34E00000023010400
  4803.     ?debug    C EB0E5F466C7573684D657373616765734E0000
  4804.     ?debug    C E34F00000023010400
  4805.     ?debug    C EB0B5F436F70795F41727261794F0000
  4806.     ?debug    C E350000000231E0400
  4807.     ?debug    C EC0C5F4765745461736B496E666F50180000
  4808.     ?debug    C E35100000023010400
  4809.     ?debug    C EC0D5F70726F636573735F696E697451180000
  4810.     ?debug    C E35200000023010400
  4811.     ?debug    C EB0F5F696E7465726E616C5F636C6F7365520000
  4812.     ?debug    C EC075F6E5461736B7304000000
  4813.     ?debug    C E3540648574E445F5F02001E40
  4814.     ?debug    C E353000200155404
  4815.     ?debug    C EB0C5F68776E644D616E61676572530000
  4816.     ?debug    C E35500B0041A2B
  4817.     ?debug    C EC095F5F70726F6365737355000000
  4818.     ?debug    C E35600B0041A2B
  4819.     ?debug    C EC095F5F7A6F6D6269657356000000
  4820.     ?debug    C E35700000023010400
  4821.     ?debug    C E35800000023010400
  4822.     ?debug    C EC085F696E635F70696458180000
  4823.     ?debug    C E3590042001A04
  4824.     ?debug    C EC0A5F6E544B45786563496E04000000
  4825.     ?debug    C EC0B5F6E544B457865634F757404000000
  4826.     ?debug    C E35A00000023040400
  4827.     ?debug    C EC0B5F746B65726E5F657865635A180000
  4828.     ?debug    C E35B00000023040500
  4829.     ?debug    C EB07465F4C444956405B0000
  4830.     ?debug    C E35C00000023040400
  4831.     ?debug    C EC0B5F746B65726E5F776169745C180000
  4832.     ?debug    C EB08465F53434F5059405B0000
  4833.     ?debug    C E35D00000023040400
  4834.     ?debug    C EC0C5F746B65726E5F77616974335D180000
  4835.     ?debug    C E35E00000023040400
  4836.     ?debug    C EC0E5F746B65726E5F776169747069645E180000
  4837.     ?debug    C E35F00000023040400
  4838.     ?debug    C EC0B5F746B65726E5F666F726B5F180000
  4839.     ?debug    C E36000000023040400
  4840.     ?debug    C EC145F746B65726E5F746F74616C5F7A6F6D6269+
  4841.     ?debug    C 657360180000
  4842.     ?debug    C E36100000023040400
  4843.     ?debug    C EC135F746B65726E5F6C6973745F7A6F6D626965+
  4844.     ?debug    C 7361180000
  4845.     ?debug    C E36200000023040400
  4846.     ?debug    C EC125F746B65726E5F6765745F70726F63657373+
  4847.     ?debug    C 62180000
  4848.     ?debug    C E36300000023040400
  4849.     ?debug    C EB115F746B65726E5F76616C69645F66696C6563+
  4850.     ?debug    C 0000
  4851.     ?debug    C E36400000023010400
  4852.     ?debug    C EC175F746B65726E5F72656769737465725F7072+
  4853.     ?debug    C 6F6772616D64180000
  4854.     ?debug    C E36500000023010400
  4855.     ?debug    C EC165F746B65726E5F70726F6772616D5F737461+
  4856.     ?debug    C 7274656465180000
  4857.     ?debug    C E36600000023010400
  4858.     ?debug    C EC135F746B65726E5F70726F6772616D5F646561+
  4859.     ?debug    C 6466180000
  4860.     ?debug    C E36700000023040400
  4861.     ?debug    C EC0B5F746B65726E5F6B696C6C67180000
  4862.     ?debug    C E36800000023010400
  4863.     ?debug    C EC1A5F746B65726E5F72656769737465725F7369+
  4864.     ?debug    C 6768616E646C657268180000
  4865.     ?debug    C E36900000023010400
  4866.     ?debug    C EC155F746B65726E5F64656C697665725F736967+
  4867.     ?debug    C 6E616C69180000
  4868.     ?debug    C E60A6E50726F6365737365730400000202000000+
  4869.     ?debug    C 086E5A6F6D626965730400000204000000067074+
  4870.     ?debug    C 4E6578741E000002060000000670744C6173741E+
  4871.     ?debug    C 0000020A000000087074506172656E741E000002+
  4872.     ?debug    C 0E0000000B687461736B506172656E7418000002+
  4873.     ?debug    C 1200000009706964506172656E74040000021400+
  4874.     ?debug    C 0000087069644368696C6404000002160000000A+
  4875.     ?debug    C 70696443757272656E7404000003280F0000086E+
  4876.     ?debug    C 5049444E65787404000002180000000C61694578+
  4877.     ?debug    C 65634572726F7273590000021A00000004424F4F+
  4878.     ?debug    C 4C0406000004425954450806000004574F52440A+
  4879.     ?debug    C 0600000544574F52440C0600000455494E540A06+
  4880.     ?debug    C 0000044C4F4E47060600000657504152414D0A06+
  4881.     ?debug    C 0000064C504152414D06060000074C524553554C+
  4882.     ?debug    C 5406060000054C505354521D060000064C504353+
  4883.     ?debug    C 54521B060000054C50494E542C060000064C5056+
  4884.     ?debug    C 4F49441C0600000648414E444C45340600000748+
  4885.     ?debug    C 474C4F42414C3406000006484C4F43414C340600+
  4886.     ?debug    C 000C474C4F42414C48414E444C45340600000B4C+
  4887.     ?debug    C 4F43414C48414E444C45340600000441544F4D0A+
  4888.     ?debug    C 0600000948494E5354414E43453206000007484D+
  4889.     ?debug    C 4F44554C45320600000A4C504341544348425546+
  4890.     ?debug    C 2C06000005485441534B18060000054846494C45+
  4891.     ?debug    C 0406000007484744494F424A3406000008434F4C+
  4892.     ?debug    C 4F525245460C0600000448574E44530600000954+
  4893.     ?debug    C 41534B454E545259310600000673697A655F740A+
  4894.     ?debug    C 0600000777636861725F740A0600000970747264+
  4895.     ?debug    C 6966665F74060600000776615F6C6973741C0600+
  4896.     ?debug    C 000B48494E5354414E43455F5F33070000074854+
  4897.     ?debug    C 41534B5F5F190700000648574E445F5F54070000+
  4898.     ?debug    C 0C7461675441534B454E54525931070000057466+
  4899.     ?debug    C 696C654A070000047461736B1F0700000A746B5F+
  4900.     ?debug    C 70726F636573732B070000047761697425070000+
  4901.     ?debug    C 0672757361676529070000
  4902.     ?debug    F task_is_dead 87 24 0    0
  4903.     ?debug    C E20006756E7573656404C002000000
  4904.     ?debug    C E20005685461736B18000370696404000B69466C+
  4905.     ?debug    C 656467656C696E6704000769506172656E740400+
  4906.     ?debug    C 096E4368696C6472656E0400086E5A6F6D626965+
  4907.     ?debug    C 7304000566696C65732000046172677621000465+
  4908.     ?debug    C 6E76702100066E466C6167730A00066E4572726F+
  4909.     ?debug    C 720400076E5369676E616C04000C706368437265+
  4910.     ?debug    C 6174656442791D0008696E747270726F6322C04A+
  4911.     ?debug    C 000000
  4912.     ?debug    C E20008775F737461747573060003775F54260003+
  4913.     ?debug    C 775F5327C004000000
  4914.     ?debug    C E20006775F706164300A0809775F526574636F64+
  4915.     ?debug    C 650A010A775F436F726564756D700A0709775F54+
  4916.     ?debug    C 65726D7369670AC004000000
  4917.     ?debug    C E20806775F706164310A080B775F53746F706576+
  4918.     ?debug    C 656E740A0809775F53746F707369670A0809775F+
  4919.     ?debug    C 53746F7076616C0AC004000000
  4920.     ?debug    C E2000872755F64756D6D7904C002000000
  4921.     ?debug    C E20003706964040009706964506172656E740400+
  4922.     ?debug    C 05685461736B18000B685461736B506172656E74+
  4923.     ?debug    C 18000769506172656E740400086E526574436F64+
  4924.     ?debug    C 6504C00C000000
  4925.     ?debug    C E20006647753697A650C0005685461736B18000B+
  4926.     ?debug    C 685461736B506172656E7418000568496E737432+
  4927.     ?debug    C 0007684D6F64756C653200037753530A00037753+
  4928.     ?debug    C 500A000977537461636B546F700A000D77537461+
  4929.     ?debug    C 636B4D696E696D756D0A000C77537461636B426F+
  4930.     ?debug    C 74746F6D0A000877634576656E74730A00066851+
  4931.     ?debug    C 75657565340008737A4D6F64756C6535000A7750+
  4932.     ?debug    C 53504F66667365740A0005684E65787434C02800+
  4933.     ?debug    C 0000
  4934.     ?debug    C E20006756E7573656404C002000000
  4935.     ?debug    C E2000574665F696404000674665F636E74040006+
  4936.     ?debug    C 74665F64657604000674665F656F6604C0080000+
  4937.     ?debug    C 00
  4938.     ?debug    C E20006756E7573656404C002000000
  4939.     end
  4940.